[gst-devel] gnonlin and ffmpeg encoder problems

Edward Hervey bilboed at gmail.com
Sat Jan 8 10:54:41 CET 2011


On Fri, 2011-01-07 at 14:55 -0700, Lane Brooks wrote:
> I have a gnonlin frontend that works fine when feeding an autovideosink 
> and the x264enc encoder. However, when I switch the encoder to a 
> ffenc_mpeg4, it quits encoding after the first source and starting 
> spewing out "Invalid timestamp" errors.
> 
> I have a simple self-contained test that shows the problem that I posted 
> to http://pastebin.com/D8UgAHqt
> 
> The script creates two gnlsources that encapsulate two videotestsrc with 
> different patterns that are arranged to play serially. The encapsulating 
> gnlcomposition feeds a ffenc_mpeg element. Only the first gnlsource gets 
> encoded in the resulting test.mp4 file. If you switch the script to use 
> the x264enc or the autovideosink, however, it works fine. The problem 
> also occurs with the mpeg2enc encoder and all the other ffmpeg encoders 
> that I have tried.
> 
> The script is completely self contained and I would be curious if others 
> can download it and see the same behavior. Am I doing something wrong or 
> is there an incompatibility between gnonlin and ffmpeg encoders.

  The problem is related to elements that don't properly take into
account segments. GNonLin makes extensive usage of playback segments
(see the documentation on new-segment event and the design docs for more
info) to do time shifting. That way it doesn't need to do a costly
re-timestamping of all buffers but instead just tweak the outgoing
segments.
  Very simplified, this means that if you have X sources, you will end
up with gnlcomposition outputting at least X segments
  NEWSEGMENT
  buffers from first source
  NEWSEGMENT
  buffers from second source
  ....

  Elements operating on time should normally use/accumulate those
newsegments (using GstSegment) to convert the buffer timestamps to
running time timestamps (basesink does this for example, which is why
you don't see any problem when using a videosink with gnonlin).

  Since a lot of elements don't do that... you need to make sure they
receive one continuous stream (with intermediary newsegment events
swallowed and buffer timestamps modified).
  Identity has got a property you can activate (single-segment) to do
exactly that.

  So basic rule of thumb : if you're using gnlcomposition, put a
"single-segment identity=True" after it (or at least before your
encoders).

  EncodeBin supports that internally.

    Edward

> 
> Thanks,
> Lane
> 
> 
> ------------------------------------------------------------------------------
> Gaining the trust of online customers is vital for the success of any company
> that requires sensitive data to be transmitted over the Web.   Learn how to 
> best implement a security strategy that keeps consumers' information secure 
> and instills the confidence they need to proceed with transactions.
> http://p.sf.net/sfu/oracle-sfdevnl 
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel






More information about the gstreamer-devel mailing list