[FFmpeg-user] h264 screenshot from multicast

basteon basteon at gmail.com
Mon Jul 1 13:39:51 CEST 2013

Well, with -vframes 1 you'll write one frame from this ts output and first
picture is grey. And you'd say so that sometimes happening, then it may
loose packets in the network and you must skip them with select option.
That becomes gray 20 times in minute or what period?

On 1 July 2013 10:06, Ståle Kristoffersen <staalebk at ifi.uio.no> wrote:

> Hi guys, I'm trying to generate a thumbnail from a multicast stream and I'm
> running into problems with h264 streams. I have written a small program to
> subscribe to a multicast stream, and write out the video-pid to disk and
> then run ffmpeg on it. Sometimes (1 out of 20 times perhaps) the output
> will be mostly gray (as in, they are missing some or most of their
> reference frames). One possible solution is to have it capture more data
> and generate thumbnail for a point in time a couple of seconds into the
> stream. While this works, it slows down the process a lot, and I want it to
> be as fast as possible.
> Is there a way to detect that the thumbnail generated is missing some
> reference data?
> Here is an example file that does not work:
> http://kolbu.ws/~chiller/h264fail.ts
> When I run it like this:
> # ffmpeg -i h264fail.ts -vframes 1 badframe.jpg
> this is the output:
> http://pastebin.com/KsVDqwPz
> and this is the file generated:
> http://kolbu.ws/~chiller/badframe.jpg
> If I ask for it to decode one second first, like this:
> # ffmpeg -i h264fail.ts -vframes 1 -ss 1 goodframe.jpg
> this is the output:
> http://pastebin.com/kwijcivf
> (The exact same output from ffmpeg, but with twice the run time)
> and this is the frame generated:
> http://kolbu.ws/~chiller/goodframe.jpg
> I can live with a couple of frames getting bad, as long as I could find a
> way to detect if it was happening, but the preferred way would be to have
> it decode until the frame was good, and then stop.
> Anyone have any input on what I could do?
> --
> Ståle Kristoffersen
> staalebk at ifi.uio.no
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user

More information about the ffmpeg-user mailing list