Encode problem with imxvpuenc_h264

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Encode problem with imxvpuenc_h264

4,250 Views
tutran
Contributor I

Hi all,

I use gstreamer plugin on iMX6DL board to capture image from camera, encode to H.264 format and stream it to PC

The pipeline I use is:

gst-launch-1.0 -v imxv4l2src device=/dev/video1 ! video/x-raw, format=I420,width=1920, height=1080 ! imxvpuenc_h264 gop-size=30 bitrate=512 ! h264parse ! rtph264pay name=pay0 pt=96 timestamp-offset=0 ! udpsink host=192.168.2.100 port=5000 &

In the client PC, I create SDP file to display the streaming video in VLC, but there is a warning "wait for SPS/PPS" looping in log, I cannot see any video content.

Could anyone point out the issue is?

I also test by saving to file by the pipeline:

gst-launch-1.0 -v imxv4l2src device=/dev/video1 ! video/x-raw, format=I420,width=1920, height=1080 ! imxvpuenc_h264 gop-size=30 bitrate=512 ! filesink location=/home/root/file.mp4

vlc can not render to play the video neither.

I just was thinking about the encoding problem of imxvpuenc_h264 problem, or please correct me if there is any incorrect in my pipeline setting.

Labels (2)
0 Kudos
2 Replies

2,396 Views
igorpadykov
NXP Employee
NXP Employee

Hi Tu

imxvpuenc_h264 is community GStreamer-imx plugin and its usage

can be found on

i.MX6 GStreamer-imx Plugins - Tutorial & Example Pipelines

alternatively one can try vpuenc_h264 from fsl-gst-plugin package,

please refer to attached Linux Guide sect.7.3.3 Video encoding.

Differencies are described on

trac.gateworks.com/wiki/Yocto/gstreamer

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

0 Kudos

2,396 Views
tutran
Contributor I

Hi Igorpadykov,

Thanks for your reply.

I also investigated the link  i.MX6 GStreamer-imx Plugins - Tutorial & Example Pipelines  you send before I starting construct the pipeline. But it still not helps.

For the attached file, it's a really updated version 4.1.15.

Currently I am using the older BSP (version 3.14.28), and the more supported plugins begin with vpuenc_(codec) are not there.

My only way is to use vpuenc and imxvpuenc_h264 for H.264 encoder.

For using examples pipeline from the reference link with imxvpuenc_h264, the pipeline I tried also output mp4 file, but I cannot view it via VLC application.

h264

h264 is a very popular encoding technology. It is most often used for HD content, such as Blu-rays and HDTV. See below for an example using the hardware accelerated h264 encoder:

# Take camera input /dev/video0, encode it to h264 at a bitrate of 10mbit/s (CBR) and save to a file. 
gst-launch-1.0  imxv4l2videosrc device=/dev/video0 ! imxvpuenc_h264 bitrate=10000 ! filesink location=/tmp/file.mp4 

Some cameras provide output that the vpu encoder can't handle, thus colorspace convert it first:

# Take camera input /dev/video0, colorspace convert it, encode it to h264 at a quant-param level of 25 (VBR) and save to a file 
gst-launch-1.0  imxv4l2videosrc device=/dev/video0 ! imxipuvideotransform ! imxvpuenc_h264 quant-param=25 ! filesink location=/tmp/file.mp4 

And my pipeline is:

gst-launch-1.0 -v imxv4l2src device=/dev/video1 ! video/x-raw, format=I420,width=1920, height=1080 ! imxvpuenc_h264 gop-size=30 bitrate=512 ! filesink location=/home/root/file.mp4

0 Kudos