Only partial file is encoded : using mpegtsmux
Tim Müller
tim at centricular.com
Fri Nov 13 00:55:51 PST 2015
On Fri, 2015-11-13 at 10:12 +0530, Sujata Gaddemane wrote:
Hi,
> I am using following pipeline to decode audio and video of the stream
> from file and encode them and then finally mux both audio and video
> using mpegtsmux.
> The resultant muxed file is way smaller than the original file and
> the pipeline just hangs. Can anyone help me to solve this issue? Any
> pointers to how to debug this issue will be of great help.
>
> gst-launch-1.0 filesrc location=B4USO129606056.ts ! tsdemux name=d !
> queue ! h264parse ! avdec_h264 ! videoconvert ! x264enc ! queue !
> mux. d. ! queue ! aacparse ! avdec_aac ! audioconvert ! voaacenc !
> queue ! mux. mpegtsmux name=mux ! filesink location=out.ts
The problem here is probably that there isn't enough buffering in the
audio branch.
x264enc by default consumes up to 2-3 seconds of buffers before it
outputs a first encoded buffer. tsmux needs a buffer from both the
audio and the video branch before it can output anything, but once the
audio queues run full tsdemux will be stuck and can't push more buffers
into the video branch and then everything hangs. queue by default
provides 1 second of buffering, so there's 2 seconds of buffering in
the audio branch. You can check if this is the problem by setting
x264enc tune=zerolatency. If so, just set the audio queue to unlimited,
like queue max-size-bytes=0 max-size-time=0 max-size-buffers=0.
It would also hang if the input file didn't contain any AAC audio or
H264 video but data in some different format.
Cheers
-Tim
--
Tim Müller, Centricular Ltd - http://www.centricular.com
More information about the gstreamer-devel
mailing list