I am trying to save a video stream (coming from my webcam) to a MKV and FLV file. This means that I have to separate the video and audio wiring after h264 encoding and multiplex each path using a different multiplayer.
Here is how I think it should work:
|->queue->matroskamux->filesink v4l2src->videorate->videoscale->x264enc->tee-| |->queue->flvmux->filesink
Is this assumption correct? Are all the lines in the right places? What will the GStreamer team look like? I have a particular problem with the yew concept. How / where to run them in a team and how to manipulate different Troika. I looked at "Tee" in the GStreamer documentation, but I still have problems using them.
Thanks in advance!
EDIT: Well, thanks mreithub, I got it for the video. This is what the command looks like:
gst-launch-0.10 -v -m v4l2src ! videorate ! videoscale ! ffmpegcolorspace ! x264enc ! tee name=muxtee ! queue2 ! matroskamux name=mkvmux ! filesink location=file1.mkv muxtee. ! queue ! flvmux name=flvmux ! filesink location=file1.flv
Here is my attempt to start the sound:
gst-launch-0.10 -v -m v4l2src ! videorate ! videoscale ! ffmpegcolorspace ! x264enc ! tee name=muxtee ! queue2 ! matroskamux name=mkvmux pulsesrc ! ffenc_aac ! filesink location=file1.mkv muxtee. ! queue ! flvmux name=flvmux pulsesrc ! ffenc_aac ! filesink location=file1.flv
This does not work (the command executes, but stops immediately - there is no error message). But I also have problems determining the position in which audio coding should be placed. In my attempt at a solution, I encode audio in each Tee-Pipeline (right?). But I would like to encode the sound only once, and then just mux it along both pipelines respectively.
Here's another try: after encoding the sound, I broke pipleine with Tee and assigned it to mkvmuxer and flvmuxer:
gst-launch-0.10 -v -m v4l2src ! videorate ! videoscale ! ffmpegcolorspace ! x264enc ! tee name=muxtee ! queue2 ! matroskamux name=mkvmux ! filesink location=file1.mkv muxtee. ! queue ! flvmux name=flvmux ! filesink location=file1.flv pulsesrc ! ffenc_aac ! tee name=t2 ! queue ! mkvmux. t2. ! queue ! flvmux.
But with this, I get the following error message:
could not link queue1 to flvmux
Thanks!