single frame snapshot

jmz jmzheng at gmail.com
Fri Jul 14 06:45:30 UTC 2017


I want to take a snapshot of one single frame from H.264 stream. I have tried
several pipelines but they did not work.

1. I used "pngenc snapshot=true ! filesink" as follows:
... ! h264parse ! avdec_h264 ! videoconvert ! pngenc snapshot=true !
filesink location=sink.png

Although one sink.png file was generated, several PNG images, in fact, are
stored in this file (see the finding in my next pipeline).

2. I replaced filesink with multifilesink as follows:
... ! h264parse ! avdec_h264 ! videoconvert ! pngenc snapshot=true !
multifilesink location=img%d.png

Three files img1.png ~ img3.png were generated. I found that the total size
of the three files is equal to the size of the previous sink.png. Why
doesn't "snapshot=true" (Send EOS after encoding a frame) work with pngenc?

3. I added "next-file=key-frame" to multifilesink as follows:

... ! h264parse ! avdec_h264 ! videoconvert ! pngenc snapshot=true !
multifilesink location=key%d.png next-file=key-frame

Only one key1.png was generated. But the file size is equal to the sink.png
(also the sum of img1.png ~ img3.png). Should "next-file=key-frame" generate
new file at only keyframe?

Can I use jpegenc to take one single JPEG snapshot of H.264 stream?




--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/single-frame-snapshot-tp4683820.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list