Playbin -> play audio and video + record it to a file

Sebastian Dröge sebastian at centricular.com
Mon Apr 7 23:34:10 PDT 2014


On So, 2014-04-06 at 19:50 +0200, stic at free.fr wrote:
> Hi guys,
> 
> I use playbin element to play video/audio.
> It works fine, audio+video is shown.
> But I would like it (audio+video) to be recorded to a file at the same time, so here is what I did:
>  - created a new bin element, and added required elements to it (encodebin, file sink, video sink, audio sink, queues...).
>  - Added a tee in the bin with 3 branches: one for audio sink, one for video sink, one for file sink.
>  - So in the bin I have after the tee:
>   1- tee ! file queue ! encodebin ! file sink
>   2- tee ! video queue ! video sink
>   3- tee ! audio queue ! audio sink
>  - the tee is linked to the sink pad of the bin with a GhostPad
>  - the bin is set to 'video-sink' AND 'audio-sink' of playbin element.
> 
> But it works if I do this only for video ... so I am able to show video+audio and at the same time to record video only to a file.
> As soon as I add the audio sink to the bin, add the 3rd tee branch, and set 'audio-sink' to the bin, it fails!
> The playbin element fails saying it doesn't find the corresponding decoders elements ... but i know the elements are not missing because it is able to display video+audio.
> 
> I am not sure to do things correctly ... can I add the same bin element to 'video-sink' and 'audio-sink' of playbin ?
> Or do I have to build 2 different bin (one for audio, one for video) ?
> 
> I did not find a way to do this ... :/
> Please can someone provide any help about this ? I am really stuck ...
> Thank you

You can't set the same element as video-sink and audio-sink on playbin,
it must be different elements, for the same reason why you can't have
the same element inside two different bins (which they end up being).

-- 
Sebastian Dröge, Centricular Ltd - http://www.centricular.com
Expertise, Straight from the Source
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 949 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20140408/9e9dae2f/attachment.sig>


More information about the gstreamer-devel mailing list