Snapshot doesn't produce a good image for mpeg-ts video

Grégoire Gentil gregoire at
Mon Sep 17 18:38:47 UTC 2018

When using the snapshot application:

I have only modified the code to put 50% instead of 5% for the seek 

gcc snapshot.c `pkg-config --cflags --libs gstreamer-1.0 gtk+-3.0`

it's working well with a mp4 file but it generates a gray image for a 
mpeg-ts file. See two examples (mp4 and mpeg-ts) here:

I think that the reason is that the mpeg-ts has less information about 
timestamp so it needs a few frames before it decodes properly a key frame.

How can the source code be patched so that multiple successive frames 
are decoded before the sample is taken?

Note that if I play the mpeg-ts file and I seek, the first few frames 
after the seek are also gray for the same reason explained above. Once 
again, this is due to the lack of information of frame timestamp in the 
mpeg-ts container,


PS: I have opened a bug 
( but as it's more an 
enhancement request of this application than a crashing bug, I post it 
to the mailing list.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: snapshot-mp4.png
Type: image/png
Size: 31572 bytes
Desc: not available
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: snapshot-mpeg-ts.png
Type: image/png
Size: 22768 bytes
Desc: not available
URL: <>

More information about the gstreamer-devel mailing list