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

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


When using the snapshot application:

https://github.com/GStreamer/gst-plugins-base/blob/master/tests/examples/snapshot/snapshot.c

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

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:

http://gentil.com/tmp/snapshot.zip

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,


Grégoire

PS: I have opened a bug 
(https://bugzilla.gnome.org/show_bug.cgi?id=797155) 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: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20180917/b18ad394/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: snapshot-mpeg-ts.png
Type: image/png
Size: 22768 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20180917/b18ad394/attachment-0003.png>


More information about the gstreamer-devel mailing list