How to drop first X frames or first X seconds of video

a b genericgroupmail at gmail.com
Wed Jun 5 03:50:23 PDT 2013


Hi all,

I have an issue with capturing a single snapshot from one particular device.
Very often when starting to stream from one of our capture cards using
the decklinksrc element the first few seconds of video are badly
tuned/rendered before things finally correct themselves and the video
appears normal.
The way in which i am taking a screen shot means that the first video
frame is output to an image file, which for this device means a very
poor snapshot.
There is no issue with the v4l2src capture cards as the first frame is
always perfectly tuned/rendered.

Here is how i am doing it:

gst-launch decklinksrc mode=2 connection=4 ! ffmpegcolorspace !
video/x-raw-rgb ! pngenc snapshot=true ! filesink location="frame.png"

Is there anyway or any element i can use to drop the first few seconds
of video or the first e.g. 90 frames before taking the snapshot?
I had read about the valve element and played with it but didn't see
how it was going to work (for a start it causes execution to block).
Ideally I'd like the command to run and finish with no further
interaction as it does at the moment.
If there is no real way to do it via a command line, then it would be
useful if anyone could point to a way to do it programatically via
python.

Thanks in advance.


More information about the gstreamer-devel mailing list