A problem about writing code with avimux.

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

A problem about writing code with avimux.

Laurence
I am writing the code to mux video stream and audio stream into a single .avi file. A part of my code
 is as follow:
 
        /*element link*/
        gst_element_link_many(videotestsrc, queue, NULL);
        gst_element_link_many(audiotestsrc, queue, NULL);
        gst_element_link_many(queue, avimux, filesink, NULL);

The elements are linked, but filesink doesn't work.I think there is something wrong about element linking.Maybe I should link the other elements or add some parameters?

Any input on this problem welcome,

Laurence
Reply | Threaded
Open this post in threaded view
|

Re: A problem about writing code with avimux.

Sandeep Prakash
Laurence wrote
I am writing the code to mux video stream and audio stream into a single .avi file. A part of my code
 is as follow:
 
        /*element link*/
        gst_element_link_many(videotestsrc, queue, NULL);
        gst_element_link_many(audiotestsrc, queue, NULL);
        gst_element_link_many(queue, avimux, filesink, NULL);
Are you sure all the elements in your code are in the same bin. If not add it.

The above statements are wrong. You cannot use the same "queue" element for both audio and video.
Take separate queues for each type of stream. Or use "multiqueue". Check the return values of gst_element_link_many.

If you are creating a "queue" element, then it will be failing. (multiqueue would succeed).

A better option would be to use pad link (gst_pad_link) when dealing with muxers. Get the
video and audio pads of muxer and link them with the corresponding queues.

Regards,
Sandeep Prakash
http://sandeepprakash.homeip.net
Reply | Threaded
Open this post in threaded view
|

Re: A problem about writing code with avimux.

Laurence
thanks a lot!!