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

stic at free.fr stic at free.fr
Sun Apr 6 10:50:57 PDT 2014


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


More information about the gstreamer-devel mailing list