[gst-devel] cating streams question

Wim Taymans wim.taymans at chello.be
Thu Jan 11 22:38:42 CET 2001

On 11 Jan 2001 16:06:09 -0500, David Helder wrote:
> I'd like to write a program that concatenates two video files, like this:
>       streamcat a.mpeg2 b.mpeg2 > c.mpeg2

The easy way would be to decode both streams and encode them into MPEG2
again. We don't have
a multifile source element yet, but it's quite trivial to create one. 
Obviously you lose some quality then but it might be your only option if
the two streams 
differ in bitrate/resolution/etc... the solution then would be (assuming
plain video, assuming we have
a disksink):

gstreamer-launch 'multifilesrc location=a.mpeg2,b.mpeg2 ! mp2videoparse
! mpeg2play ! 
                          mpeg2enc ! disksink location=c.mpeg2'

The problem with the concatentation is only situated in the last video
GOP (group of pictures), where
the two streams meet. Depending on how the end/start of the stream is
encoded you might just
re-encode the last GOP and just copy the rest of the streams. I don't
think we have the right
plugins to do that right now.

> Can I do this with GStreamer?  I looked over the docs, but I'm not

> sure how to (what decoders/encoders would I use, etc?).
> I'd also like to mix audio into movies like this:
>       streamcat a.mpeg2 s.wav > c.mpeg2
>   (a.mpeg2 would loop if s.wav is longer.)

this one is easy, you'll have to write a program for this or use the
editor (when it can handle
dynamic pads). Your program creates the following graph:

disksrc a.mpeg2 (loop=true) --> (video pad) \
system_encode --> fdsink c.mpeg2
disksrc wav -----> lame ---> (audio pad) /

if you're talking about MPEG2 and you want to create a PES system
stream: we don't have
and multiplexer yet, only for mpeg1 system streams.

So to answer your question: yes GStreamer can do it (I'm going to write
a NLE video app soon),
but not out of the box, You'll need to create a few simple plugins

> How would I do this?
> Thanks,
> David
> -- 
>       __          _    __  David Helder - University of Michigan
>   ___/ /__ __  __(_)__/ /  dhelder at umich.edu
>  / _  / _ `/ |/ / / _  /   http://www.eecs.umich.edu/~dhelder
>  |_,_/|_,_/|___/_/|_,_/    Jungle Monkey: http://www.junglemonkey.net
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> http://lists.sourceforge.net/lists/listinfo/gstreamer-devel

Who's on first?

More information about the gstreamer-devel mailing list