example for streamsynchronizer?

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

example for streamsynchronizer?

hammerwerfer
Hello,
 
can someone provide a litte example code (c, python, whatever) how to use the streamsynchronizer plugin?
 
usually i am creating my piplines like this:
 
src = Gst.ElementFactory.make("filesrc")
src.set_property("location", path)
pipeline.add(src)
 
decoder = Gst.ElementFactory.make("decodebin")
pipeline.add(decoder)
 
venc = Gst.ElementFactory.make("x264enc")
pipeline.add(venc)
 
aenc = Gst.ElementFactory.make("voaacenc")
pipeline.add(aenc)
 
decoder.connect("pad-added", gst_pad_added, aenc, venc)
 
So the pad_added callback links from decoder pads to audio and video element pads accordingly.
gst-inspect for streamsynchronizer has pad-added signals as well. Do i need a pad--added callback as well?
 
Thanks,
Jens

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: example for streamsynchronizer?

Tim Müller
On Wed, 2017-02-01 at 23:56 +0100, [hidden email] wrote:

Hi,
 
> can someone provide a litte example code (c, python, whatever) how to
> use the streamsynchronizer plugin?

Let's take a step back - what are you actually trying to achieve? Most
people should not need to use the streamsynchronizer element ever. It
might not do what you want it to do, it's slightly misnamed.

Cheers
 -Tim

--
Tim Müller, Centricular Ltd - http://www.centricular.com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Aw: Re: example for streamsynchronizer?

hammerwerfer
Hi Tim,
 
thanks for you reply. I have a bunch of video files (mp4) WITHOUT audio track and another bunch of video files (mixed formats) WITH audio track. I want them all concatenated together. The videos with audio track should be kept as they are the others without audio track got a new audio track mixed in from MP3.
 
My pipeline looks like this (schematic).
 
part 1: video without audio track and separate audio file:
filesrc -> flvdemux -> h264parse -> concat (video)
filesrc -> decodebin -> concat (audio)

part 2: video with audio track:
                       ->  x264enc -> concat (video)
filesrc -> decodebin +|
                       ->  concat (audio)

part 3: mux concatenated streams together into filesink
concat (video)                             \
                                            --> matroskamux -> filesink
concat (audio) -> audioconvert -> voaacenc /

I put everything together programmatically via python bindings. I loop through a list of files where part1 and part2 creates dynamically new sources and links them to the concat elements. Everything is working quite well BUT the streams are somehow drifting apart.
The goal is that the videos with audio track should be synchron to its audio in the big concatenated video. I guess streamsynchronizer should do the trink but i am not sure where to put it in and how to link it programmatically (pad-added probe or just "decodebin.link(streamsynchronizer)" and so on).
Besause it is enough to have part2 sources av-synchronous i tried to create every time a new streamsynchronizer element. But everything i tried so far ended in nothing has changed or the pipeline just stopped and hangs in a paused state. I hope its more or less understandable.
 
Regards,
Jens
 
Gesendet: Sonntag, 05. Februar 2017 um 12:14 Uhr
Von: "Tim Müller" <[hidden email]>
An: [hidden email]
Betreff: Re: example for streamsynchronizer?
On Wed, 2017-02-01 at 23:56 +0100, [hidden email] wrote:

Hi,
 
> can someone provide a litte example code (c, python, whatever) how to
> use the streamsynchronizer plugin?

Let's take a step back - what are you actually trying to achieve? Most
people should not need to use the streamsynchronizer element ever. It
might not do what you want it to do, it's slightly misnamed.

Cheers
-Tim

--
Tim Müller, Centricular Ltd - http://www.centricular.com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel