mofei
mofei

Reputation: 13

ffprobe output video: png

ffprobe is telling me that my video file is a png.

[png_pipe @ 0x7f9ece003c00] Stream #0: not enough frames to estimate rate; consider increasing probesize
Input #0, png_pipe, from '1.ts':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: png, rgb24(pc), 1x1 [SAR 3779:3779 DAR 1:1], 25 tbr, 25 tbn, 25 tbc

enter image description here

I'm a little bit confused, as it plays fine as a ts or mpeg file. But when I run ffmpeg -y -i in.ts -acodec copy -vcodec copy out.mp4 the command completes fine, but I end up with a file that can't be played. I get an alert that says "The operation could not be completed" from Quicktime, and I can't open it in Chrome or Firefox either so I know it's not an issue with Quicktime.

So, this probably has to do with the video being a png video. I always thought that png was a format for images only, but here I am. Can someone give me some info on this, and how can I convert it to an mp4?

Upvotes: 1

Views: 3322

Answers (2)

Xen
Xen

Reputation: 164

I had the same issue, it could be a stream masqueraded with a PNG header.

I used dd to strip the 1st 8 bytes off and ffprobe detected the correct format.

dd if=1.ts of=fixed/1.ts ibs=8 skip=1

Upvotes: 2

Gyan
Gyan

Reputation: 92928

By using -vcodec copy, you are storing the video as a PNG stream in a MP4. This is valid but not widely supported by players. Instead, encode it to a standard H.264 yuv420p pixels stream.

ffmpeg -y -i in.ts -c:a copy -c:v libx264 -pix_fmt yuv420p out.mp4

Edit:

The chunk is actually MPEG-TS but first 127 bytes appears to be a small PNG file affixed at the front. Forcing input format allows correct decoding.

So run,

ffmpeg -y -f mpegts -i in.ts -c copy out.mp4

Upvotes: 2

Related Questions