This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TDA4VH-Q1: GStreamer using v4l2h264enc, input NV12 with row width not aligned 64bytes

Part Number: TDA4VH-Q1
Other Parts Discussed in Thread: TDA4VH

Tool/software:

Hello,

I am trying to encode some NV12 input data using GStreamer and encoder v4l2h264enc on TDA4VH. I am doing a "per-frame" encoding using appsrc and appsink. The NV12 data is wrapped into a GstBuffer, and then sent to the GStreamer pipeline.

Pipeline string:

"appsrc name=mysource format=time ! "
"video/x-raw,format=NV21 ! " // NV21 to reverse channels
"v4l2h264enc name=v4l2h264enc extra-controls=\"enc,prepend_sps_and_pps_to_idr=1,video_gop_size=1\" ! "
"video/x-h264 ! "
"appsink name=mysink emit-signals=false sync=false drop=false",
 

It works well except that I need to explicitly restructure the input data as a continuous block memory to have the right image at decoding (decoding the encoded data). My NV12 image as width of 3848, with stride of 3904 (64 byte aligned). When doing some manipulations to provide to the pipeline NV12 data with stride of 3848 (width==stride), I have the right image output at decoded. 

----

My goal is to avoid doing those manipulations, before sending to the pipeline (giving the raw NV12 data). Is there a way to properly encode (v4l2h264enc) an NV12 image with width != stride ?