Not able to Display and Encode YUV in single pipe.

Tim Müller tim at centricular.com
Tue Nov 10 00:52:27 PST 2015


On Mon, 2015-11-09 at 22:35 -0800, ssshukla26 wrote:

Hi,

> Display +  Encode (*Not Working*) [/Its showing a blank screen and
> getting
> stuck at one point/]:
> 
> gst-launch-1.0 -v filesrc location=rawvideo.yuv blocksize=480600 !
> videoparse width=640 height=480 framerate=30/1 ! videoconvert ! queue
> ! tee
> name=t t. ! autovideosink t. !
> video/x-raw,format=I420,width=640,height=480,framerate=30/1 ! x264enc
> !
> mpegtsmux ! filesink location=final.mp4

The reason here is that you need a queue in each branch after a tee in
order for both sinks to preroll. Also, you need to make sure there's
enough queuing/buffering in the pipeline to accommodate x264enc in its
default settings here (which might take up to 2-3 secs of video before
outputting anything). Also, either drop the capsfilter or move it right
after the videoconvert (but before the tee).

Try something like:

gst-launch-1.0 -v filesrc location=rawvideo.yuv ! \
  videoparse format=i420 width=640 height=480 framerate=30/1 ! tee
name=t \
  t. ! queue max-size-bytes=0 max-size-time=0 max-size-buffers=0 ! \
         videoconvert ! videoscale ! autovideosink \
  t. ! queue ! x264enc ! mpegtsmux ! filesink location=final.ts

Also, if you want an .mp4 file you need mp4mux instead of mepgtsmux.

I've dropped the blocksize from filesrc, videoparse should determine
that based on the format + resolution.

Cheers
 -Tim

-- 
Tim Müller, Centricular Ltd - http://www.centricular.com




More information about the gstreamer-devel mailing list