I trying to use qtmux to merge audio and video to *mp4 file with GStreamer. My pipeline looks like:
gst-launch-1.0 autovideosrc ! x264enc ! queue ! qtmux0. autoaudiosrc ! wavenc ! queue ! qtmux ! filesink location=file.mp4
videotestsrc --> x264enc -----\
>---> qtmux ---> filesink
audiotestsrc --> wavenc ------/
It's working good with command line. I didn't find any useful example in C to reach this goal. How can I do it with C code?
[UPDATE]
gst_element_link_many(audiosource, wavenc, audioqueue, NULL);
gst_element_link_many(videosource, x264enc, videoqueue, NULL);
gst_element_link_many(qtmux, filesink, NULL);
audio_pad = gst_element_get_request_pad (audioqueue, "src");
mux_audio_pad = gst_element_get_static_pad (qtmux, "sink_1");
gst_pad_link (audio_pad,mux_audio_pad); ERROR HERE
video_pad = gst_element_get_request_pad (videoqueue, "src");
mux_video_pad = gst_element_get_static_pad(qtmux, "sink_2");
gst_pad_link (video_pad,mux_video_pad); ERROR HERE
This is the way I merge audio and video to qtmux. But it's wronged in step link pads.
Hi
You need analysis https://github.com/GStreamer/gstreamer/blob/master/tools/gst-launch.c to follow the source code about how to parse args
BR
Zhiming