Video mixing, EOS and seeking
sebastian at centricular.com
Tue Apr 22 04:50:52 PDT 2014
On Di, 2014-04-22 at 02:07 +0000, Alexandre Quessy wrote:
> Hello everyone,
> I am working on a simple video mixer for theatrical shows. It should play
> video clips, looping them or pausing them when they are done playing, and
> it should be able to do crossfade transitions between clips. Everything
> worked well until I implemented the crossfades, using "alpha" elements and
You can omit the alpha elements and just set the "alpha" property on the
videomixer sinkpads. Works the same way but is more efficient.
> Now, when the end (EOS) of a clip is reached, the image
> become black. Here is an ASCII art representation of my pipeline:
> filesrc -> decodebin -> videoscale -> alpha -> videomixer ->
> ffmpegcolorspace -> xvimagesink
> filesrc -> decodebin -> videoscale -> alpha -/
> This brings some questions:
> * How can I catch the EOS signal of a specific video file, and then start
> over the playback of that file without affecting the other one? I use
> filesrc and decodebin. Do I need to enclose them in a bin?
Use a pad probe to drop the EOS event, or just use non-flushing segment
seeks on those sources. They will report an segment-done messages
instead of the EOS event then and you can then handle that in whatever
way you want.
> * How can I stop the playback of a single file and let the other one play?
Remove the corresponding videomixer sinkpad, then videomixer won't wait
for data to arrive on that one and would just continue.
When adding/removing branches to the tee you need to be careful to give
new branches a running time that allows them to play synchronised with
the other streams. E.g. if you want new branches to be shown immediately
from their beginning, you could set the base field in their segments to
the current running time of the pipeline (or use gst_pad_set_offset())
for that. Somewhere on this list there was some example code to do
exactly that, this bug also contains something like this:
Sebastian Dröge, Centricular Ltd - http://www.centricular.com
Expertise, Straight from the Source
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 949 bytes
Desc: This is a digitally signed message part
More information about the gstreamer-devel