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

stic at stic at
Tue Apr 8 00:33:00 PDT 2014

Thank you Sebastian for your answer.
In that case, if I have to create 2 different bin, how can I then connect them to mux audio+video together to the same encodebin element ?

----- Mail original -----
De: "Sebastian Dröge" <sebastian at>
À: "Discussion of the development of and with GStreamer" <gstreamer-devel at>
Envoyé: Mardi 8 Avril 2014 08:34:10
Objet: Re: Playbin -> play audio and video + record it to a file

On So, 2014-04-06 at 19:50 +0200, stic at 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 -
Expertise, Straight from the Source

gstreamer-devel mailing list
gstreamer-devel at

More information about the gstreamer-devel mailing list