[gst-devel] Joining Two Video Streams using GNonLin

Edward Hervey bilboed at gmail.com
Wed Jun 23 09:05:44 CEST 2010


On Tue, 2010-06-22 at 23:47 -0700, Sandeep Prakash wrote:
> Hi All,
> 
> I am writing a simple gst application to cut and join 2 video files (both
> mp4/mpeg-4) using GNonLin. 
> The pipeline I am constructing in my application goes like this:
> 
> gnlcomposition \(name=comp 
>                  gnlfilesource \(name=video1 start=0 duration=10
> media-start=25 media-duration=10         
>                                       location=file1.mp4 \)
  Remove the '(' ')' after gnlfilesource, they're just properties of
gnlfilesource.
  Also all the start/duration properties are in nanoseconds, so unless
you want to only play 10nanoseconds I'd suggest multiplying those values
by 1 000 000 000

>                  gnlfilesource \(name=video2 start=10 duration=10
> media-start=0 media-duration=10 
>                                       location=file2.mp4 \) \)

  Same comment as above

> comp.src ! ffmpegcolorspace ! tee name=videotee videotee.src0 ! queue !
> xvimagesink videotee.src1 ! 
> queue ! identity single-segment=true ! videoscale ! 
> "video/x-raw-yuv, width=(int)800, height=(int)480" ! videorate !
> ffenc_mpeg4 ! mux. ffmux_3gp name=mux ! filesink location=out.3gp

  Use mp4mux instead of ffenc_mpeg4.

> 
> This pipeline joins 2 video streams each of 10 seconds. A 10 second chunk is
> cut in the middle 
> of each of the files from 25th sec to 35th sec of the 1st file and 0th sec
> to 10th sec of the 2nd file.
> 
> In the above pipeline I am facing an issue like this:
> -> When file1.mp4 and file2.mp4 are same or have the same FPS, then the
> resulting out.3gp 
>      is properly encoded.
> -> When file1.mp4 and file2.mp4 have different FPS, then in the resulting
> out.3gp, the frames from 
>      file1.mp4 is encoded properly, but the frames from file2.mp4 is
> corrupted. 
>      When played in mplayer following is the o/p:
> 	[mpeg4 @ 0x18bffe0]hmm, seems the headers are not complete, trying to guess 
>                                       time_increment_bits
> 	[mpeg4 @ 0x18bffe0]my guess is 14 bits ;)
> 	[mpeg4 @ 0x18bffe0]hmm, seems the headers are not complete, trying to guess 
>                                       time_increment_bits
> 	[mpeg4 @ 0x18bffe0]my guess is 11 bits ;)
> 	[mpeg4 @ 0x18bffe0]Error, header damaged or not MPEG4 header (qscale=0)
> 	[mpeg4 @ 0x18bffe0]header damaged
> 	Error while decoding frame!
> 	[mpeg4 @ 0x18bffe0]Error, header damaged or not MPEG4 header (qscale=0)
> 	[mpeg4 @ 0x18bffe0]header damaged
> 	Error while decoding frame!
>         ****************For all the Frames*****************
> 
> Could anyone help me out in this regard and suggest some alternatives.
> 
> Other Details:
> Gst Version:        0.10.25
> GNonLin Version: 0.10.13
> 
> Thanks in advance
> Sandeep Prakash






More information about the gstreamer-devel mailing list