x264enc causes video to freeze

Tim-Philipp Müller t.i.m at zen.co.uk
Thu Feb 9 12:25:16 PST 2012


On Thu, 2012-02-09 at 15:31 +0000, O'neill, Gerry wrote:

Hi Gerry,

> I am having problems getting this pipeline to work.
>
> gst-launch -v filesrc location=6_avc.mp4 ! \
> 
>                 qtdemux  ! queue ! ffdec_h264 ! videoscale ! \
> 
>                 capsfilter caps=video/x-raw-yuv,width=640,height=480 !
> \ 
> 
> ffmpegcolorspace ! tee name=myT ! xvimagesink  \
> 
>                 myT. ! x264enc ! mpegtsmux ! filesink location=surf.ts
> 
>  
> 
> The problem seems to be with x264enc (works with ffenc_mpeg4).
> 
> Any suggestions greatly appreciated?

Well, there are multiple problems I think, but the main problem is
likely indeed x264enc, which by default is configured to have a very
high latency, higher than queue's default buffer size.

For one, you need a queue in every branch after the tee, i.e. before
xvimagesink and before x264enc.

Then, to overcome the issue with the pipeline not prerolling because
x264enc may buffer more internally than the queue in the other branch
can buffer:

 - try queue max-size-buffers=0 max-size-bytes=0 max-size-time=0
 - try x264enc tune=zerolatency (likely impacts quality though)

Cheers 
 -Tim



More information about the gstreamer-devel mailing list