How can I use audiomixer?

Johan Basore johan_dream at hotmail.com
Sun Apr 24 14:06:25 UTC 2016


Hello,

I am a GStreamer beginner and I am working with audiomixer now.
Here are the source codes.

/***********************************************************************/
    pipeline = gst_pipeline_new("pipelinecomposer");
    source1 = gst_element_factory_make("filesrc", "source1");
    source2 = gst_element_factory_make("filesrc", "source2");
    sink = gst_element_factory_make("filesink", "sink");
    mpegtsmux = gst_element_factory_make("mpegtsmux", "mpegtsmux");
    decodebin1 = gst_element_factory_make("decodebin", "decodebin1");
    decodebin2 = gst_element_factory_make("decodebin", "decodebin2");
    audioconvert = gst_element_factory_make("audioconvert", "audioconvert");
    audioconvert1 = gst_element_factory_make("audioconvert",
"audioconvert1");
    audioconvert2 = gst_element_factory_make("audioconvert",
"audioconvert2");
    avenc_ac3_1 = gst_element_factory_make("avenc_ac3", "avenc_ac3_1");
    audiomixer = gst_element_factory_make("audiomixer", "audiomixer");
    audioresample = gst_element_factory_make("audioresample",
"audioresample");
    
    g_object_set (G_OBJECT (avenc_ac3_1), "bitrate", 192000, nil);
       
    g_object_set (G_OBJECT (source1), "location",
"/Users/johanbasore1/Movies/1.webm", NULL);
    g_object_set (G_OBJECT (source2), "location",
"/Users/johanbasore1/Movies/2.webm", NULL);
    
    g_object_set (G_OBJECT (sink), "location",
"/Users/johanbasore1/Movies/output.avi", NULL);
       
    g_signal_connect(decodebin1, "pad-added",
G_CALLBACK(on_pad_added_audio1), audioconvert1);
    g_signal_connect(decodebin2, "pad-added",
G_CALLBACK(on_pad_added_audio2), audioconvert2);   
    
    gst_bin_add_many(GST_BIN (pipeline), source1, decodebin1, mpegtsmux,
sink, source2, decodebin2, audioconvert1, audioconvert2, audiomixer,
avenc_ac3_1, audioconvert, audioresample, nil);
    
    gst_element_link(source1, decodebin1);
    gst_element_link(source2, decodebin2);   
    gst_element_link(audioconvert1, audiomixer);
    gst_element_link(audioconvert2, audiomixer);
    gst_element_link_many(audiomixer, audioconvert, avenc_ac3_1, mpegtsmux,
nil);
    
    gst_element_set_state(pipeline, GST_STATE_PLAYING);

/***********************************************************************/

I have added 2 audio sources ( source1, source2 ) and used a audiomixer.
But the pipeline not plays, it is remained as READY state.
I found that first step (source->audioconvert) works well. Maybe step 2
(audioconvert->audiomixer) has problem.
There are also codes for video decode and encode, but it works well so I
abbreviated here.

Can anyone knows what is wrong with audiomixer?

Thanks



--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/How-can-I-use-audiomixer-tp4677079.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list