1

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?

2 Answers 2

2

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
1
  • Thanks, this worked! Can you explain the encoding, because I'm still confused on why ffprobe returned png?
    – mofei
    Apr 21, 2020 at 18:03
2

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
17
  • It says invalid png signature i.imgur.com/P5Nw4Nm.png.
    – mofei
    Dec 15, 2019 at 8:48
  • Does ffplay in.ts play the file?
    – Gyan
    Dec 15, 2019 at 9:06
  • No, I get the same invalid png signature.
    – mofei
    Dec 15, 2019 at 9:23
  • Which player plays it?
    – Gyan
    Dec 15, 2019 at 9:32
  • Only Quicktime. Chrome and Firefox show a tiny white dot, that's not even a video (probably has to do with the png), and VLC is a 10 second video of a blank white screen. Interestingly, I tried multiple ones with different lengths in VLC, and all of them ended up being 10 seconds of nothing.
    – mofei
    Dec 15, 2019 at 9:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.