<div dir="ltr">Hi,<div><br></div><div>Thanks for your answer. I succeed to have video concatenation working with gnlcomp.</div><div>I was using this example that works : <a href="https://gist.github.com/gipi/1402097" target="_blank">https://gist.github.com/gipi/1402097</a></div>
<div><br></div><div>For the moment, I only have video concatenation working. I wanted to concatenate also audio. </div><div>If I understood correctly, I have to use two different gnlfilesource for each media, one for video, one for audio.</div>
<div><br></div><div>Even gst-launch is not working well with gnlcompo I managed to have audio and video working for one media :</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
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</blockquote>
<div><br></div><div><br></div><div>I tried so to adapt this pipeline in my C program. I do not have a deep experience so could you help me ?</div><div><br></div><div>Thanks a lot,</div><div><br></div><div>Eloi</div><div><br>
</div><div>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 :</div><div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
/* create elements */ <br> pipeline = gst_pipeline_new ("TM_video-player"); <br> conv = gst_element_factory_make ("ffmpegcolorspace", "ffmpeg-colorspace"); <br> sinkVideo = gst_element_factory_make ("ximagesink", "directdrawsink-output"); <br>
sinkAudio = gst_element_factory_make ("autoaudiosink", "autoaudiosink"); <br> comp = gst_element_factory_make("gnlcomposition", "mycomposition"); <br> <br> int cycle;<br> int n = argc - 1;<br>
isPlaying=FALSE;<br> rate=1.0;<br> GstElement* gnlfilesourceVideo[n];<br> GstElement* gnlfilesourceAudio[n];<br> GstClockTime myMediaTime = (1 * GST_SECOND * 60)+(GST_SECOND * 60);<br> /* add file sources to gnlcomposition */<br>
for (cycle = 0 ; cycle < n ; cycle++) {<br><span class="Apple-tab-span" style="white-space:pre"> </span> char videoIdx[10];<br><span class="Apple-tab-span" style="white-space:pre"> </span> sprintf(videoIdx, "video%d", cycle);<br>
<span class="Apple-tab-span" style="white-space:pre"> </span> char audioIdx[10];<br><span class="Apple-tab-span" style="white-space:pre"> </span> sprintf(audioIdx, "audio%d", cycle);<br><span class="Apple-tab-span" style="white-space:pre"> </span> gnlfilesourceAudio[cycle] = gst_element_factory_make("gnlfilesource", audioIdx); <br>
<span class="Apple-tab-span" style="white-space:pre"> </span> gnlfilesourceVideo[cycle] = gst_element_factory_make("gnlfilesource", videoIdx); <br><span class="Apple-tab-span" style="white-space:pre"> </span> gst_bin_add_many (GST_BIN (comp), gnlfilesourceVideo[cycle], gnlfilesourceAudio[cycle]); <br>
GstCaps *capsAudio =gst_caps_from_string("audio/x-raw-int");<br> GstCaps *capsVideo =gst_caps_from_string("video/x-raw-yuv;video/x-raw-rgb");<br><span class="Apple-tab-span" style="white-space:pre"> </span> g_object_set (G_OBJECT (gnlfilesourceAudio[cycle]),<br>
<span class="Apple-tab-span" style="white-space:pre"> </span> "location" , argv[cycle + 1], <br><span class="Apple-tab-span" style="white-space:pre"> </span> "start", myMediaTime * cycle,<br>
<span class="Apple-tab-span" style="white-space:pre"> </span> "duration", myMediaTime ,<br><span class="Apple-tab-span" style="white-space:pre"> </span> "media-start", 1 * GST_SECOND,<br><span class="Apple-tab-span" style="white-space:pre"> </span> "media-duration", myMediaTime,<br>
"caps",capsAudio,<br><span class="Apple-tab-span" style="white-space:pre"> </span> NULL); <br> g_object_set (G_OBJECT (gnlfilesourceVideo[cycle]),<br><span class="Apple-tab-span" style="white-space:pre"> </span> "location" , argv[cycle + 1], <br>
<span class="Apple-tab-span" style="white-space:pre"> </span> "start", myMediaTime * cycle,<br><span class="Apple-tab-span" style="white-space:pre"> </span> "duration", myMediaTime ,<br><span class="Apple-tab-span" style="white-space:pre"> </span> "media-start", 1 * GST_SECOND,<br>
<span class="Apple-tab-span" style="white-space:pre"> </span> "media-duration", myMediaTime,<br><span class="Apple-tab-span" style="white-space:pre"> </span> NULL);<br> }<br> <br> if (!pipeline || !conv || !sinkVideo /*||!sinkAudio*/ || !comp) { <br>
g_print ("One element could not be created\n"); <br> return -1; <br> }<br> <br> bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline)); <br> gst_bus_add_watch (bus, bus_call, loop); <br> gst_object_unref (bus); <br>
<br> /* put all elements in a bin */ <br> gst_bin_add_many (GST_BIN (pipeline), comp, conv, sinkVideo,sinkAudio, NULL); <br> <br> // gst_element_link (comp, sinkAudio); <br> gst_element_link (conv, sinkVideo); <br>
gst_element_link (comp, sinkAudio); </blockquote></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Mar 20, 2013 at 8:26 AM, Nicolas Dufresne <span dir="ltr"><<a href="mailto:nicolas.dufresne@collabora.co.uk" target="_blank">nicolas.dufresne@collabora.co.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>
<div>
Le mardi 19 mars 2013 à 16:35 -0400, Eloi Bail a écrit :<br>
<blockquote type="CITE">
2) using gnlcomposition<br>
</blockquote>
<br>
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.<br>
<br>
regards,<br>
Nicolas
</div>
<br>_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
<br></blockquote></div><br></div>