Best way to concatenate and play streams

Eloi Bail eloi.bail at gmail.com
Thu Mar 21 08:12:12 PDT 2013


Hi,

Thanks for your answer. I succeed to have video concatenation working with
gnlcomp.
I was using this example that works : https://gist.github.com/gipi/1402097

For the moment, I only have video concatenation working. I wanted to
concatenate also audio.
If I understood correctly, I have to use two different gnlfilesource for
each media, one for video, one for audio.

Even gst-launch is not working well with gnlcompo I managed to have audio
and video working for one media :

gst-launch-0.10 gnlcomposition name=comp gnlfilesource name=audio
> location="./mymedia.avi" name=audio caps="audio/x-raw-int" start=0
> duration=0 media-start=0 media-duration=120000000000 gnlfilesource
> name=video location="./mymedia.avi" start=0 duration=0 media-start=0
> media-duration=120000000000 audio. ! queue ! autoaudiosink sync=true video.
> ! queue ! autovideosink sync=true



I tried so to adapt this pipeline in my C program. I do not have a deep
experience so could you help me ?

Thanks a lot,

Eloi

I made the following code, but I am stuck on one image when launching it. I
think that it might be due to missing queue. I tried it without success :

 /* create elements */
>     pipeline = gst_pipeline_new ("TM_video-player");
>     conv = gst_element_factory_make ("ffmpegcolorspace",
> "ffmpeg-colorspace");
>     sinkVideo = gst_element_factory_make ("ximagesink",
> "directdrawsink-output");
>     sinkAudio = gst_element_factory_make ("autoaudiosink",
> "autoaudiosink");
>     comp = gst_element_factory_make("gnlcomposition", "mycomposition");
>
>     int cycle;
>     int n = argc - 1;
>     isPlaying=FALSE;
>     rate=1.0;
>     GstElement* gnlfilesourceVideo[n];
>     GstElement* gnlfilesourceAudio[n];
>     GstClockTime myMediaTime = (1 * GST_SECOND * 60)+(GST_SECOND * 60);
>     /* add file sources to gnlcomposition */
>     for (cycle = 0 ; cycle < n ; cycle++) {
>     char videoIdx[10];
>     sprintf(videoIdx, "video%d", cycle);
>     char audioIdx[10];
>     sprintf(audioIdx, "audio%d", cycle);
>     gnlfilesourceAudio[cycle] = gst_element_factory_make("gnlfilesource",
> audioIdx);
>     gnlfilesourceVideo[cycle] = gst_element_factory_make("gnlfilesource",
> videoIdx);
>     gst_bin_add_many (GST_BIN (comp), gnlfilesourceVideo[cycle],
> gnlfilesourceAudio[cycle]);
>  GstCaps *capsAudio =gst_caps_from_string("audio/x-raw-int");
>  GstCaps *capsVideo
> =gst_caps_from_string("video/x-raw-yuv;video/x-raw-rgb");
>     g_object_set (G_OBJECT (gnlfilesourceAudio[cycle]),
>     "location" , argv[cycle + 1],
>     "start",  myMediaTime * cycle,
>     "duration", myMediaTime ,
>     "media-start", 1 * GST_SECOND,
>     "media-duration", myMediaTime,
>                             "caps",capsAudio,
>     NULL);
>       g_object_set (G_OBJECT (gnlfilesourceVideo[cycle]),
>     "location" , argv[cycle + 1],
>     "start",  myMediaTime * cycle,
>     "duration", myMediaTime ,
>     "media-start", 1 * GST_SECOND,
>     "media-duration", myMediaTime,
>     NULL);
>     }
>
>     if (!pipeline || !conv || !sinkVideo /*||!sinkAudio*/ || !comp) {
>         g_print ("One element could not be created\n");
>         return -1;
>     }
>
>     bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));
>     gst_bus_add_watch (bus, bus_call, loop);
>     gst_object_unref (bus);
>
>     /* put all elements in a bin */
>     gst_bin_add_many (GST_BIN (pipeline), comp, conv, sinkVideo,sinkAudio,
> NULL);
>
>    // gst_element_link (comp, sinkAudio);
>    gst_element_link (conv, sinkVideo);
>    gst_element_link (comp, sinkAudio);








On Wed, Mar 20, 2013 at 8:26 AM, Nicolas Dufresne <
nicolas.dufresne at collabora.co.uk> wrote:

> **
> Le mardi 19 mars 2013 à 16:35 -0400, Eloi Bail a écrit :
>
> 2) using gnlcomposition
>
>
> Gnonlin should be your best option, at least in GStreamer 0.10. The only
> issue is that it does not work in gst-launch due to bugs with ghostpad
> creation, so it might be worth giving it a try in C.
>
> regards,
> Nicolas
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20130321/6b07b22b/attachment.html>


More information about the gstreamer-devel mailing list