Record from imxv4l2src into 2 video files

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Record from imxv4l2src into 2 video files

跳至解决方案
1,802 次查看
tutran
Contributor I

Hi,

I am trying with capture from camera, encode and save in two mkv files (one have fullHD 30fps and other have WVGA/HD resolution)

As the first thinking, I tried with tee by using the pipeline:

gst-launch-1.0 -v imxv4l2src device=/dev/video1 !  video/x-raw, format=I420,width=1920, height=1080, framerate=30/1 ! tee name=t ! queue ! imxvideoconvert_ipu l! video/x-raw, width=1280, height=720 ! imxvpuenc_h264 gop-size=30 bitrate=2000 ! h264parse ! matroskamux ! filesink location=/home/root/video2 t. ! queue ! vpuenc gop-size=30 bitrate=4000 ! h264parse ! matroskamux ! filesink location=/home/root/video1 &

When I play two video files in VLC, I found that the bitrates is decrease half. This maybe cause by the limitation of VPU encoder, only support encode one fullhd 30fps. For encode two streams at the same time, it is over limitation of VPU.

Is my understanding correct?

How can I improve the quality of two encoded videos?

I also tried with x264enc to encode WVGA file, VPU used for fullHD stream. But this is not the correct solution.

标签 (1)
0 项奖励
回复
1 解答
1,599 次查看
igorpadykov
NXP Employee
NXP Employee

Hi Tu

you are right, this could be performance limit please check

presentation p.6

Q&A: MX6 VPU H.264 Dual Stream Encode Limits | NXP Community

Best regards

igor

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

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

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

在原帖中查看解决方案

0 项奖励
回复
2 回复数
1,600 次查看
igorpadykov
NXP Employee
NXP Employee

Hi Tu

you are right, this could be performance limit please check

presentation p.6

Q&A: MX6 VPU H.264 Dual Stream Encode Limits | NXP Community

Best regards

igor

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

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

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

0 项奖励
回复
1,599 次查看
tutran
Contributor I

Hi Igor,

I change the pipeline to reduce the resolution of two video files:

gst-launch-1.0 -v imxv4l2src device=/dev/video1 !  video/x-raw, format=I420,width=1280, height=720, framerate=30/1 ! tee name=t ! queue ! imxvideoconvert_ipu ! video/x-raw, width=800, height=480 ! imxvpuenc_h264 gop-size=30 bitrate=2000 ! h264parse ! matroskamux ! filesink location=/home/root/video2 t. ! queue ! vpuenc gop-size=30 bitrate=4000 ! h264parse ! matroskamux ! filesink location=/home/root/video1 &

I can do record into 2 video files, but the issue is that sometime the video files got 0 bytes

I have enabled debug log from gstreamer GST_DEBUG=4,*imx*:9 to get the log.

And found that when the issue happens:

reamer-1.4.1/gst/gstelement.c:2233:_priv_gst_element_state_changed:<imxvideoconvert_ipu5> [00m notifying about state-changed NULL to READY (VOID_PENDING pending)
reamer-1.4.1/gst/gstbin.c:2673:gst_bin_change_state_func:<avcrecord-pipeline> [00m child 'imxvideoconvert_ipu5' changed state to 2(READY) successfully
reamer-1.4.1/gst/gstbin.c:2230:gst_bin_element_set_state:<imxvideoconvert_ipu5> [00m current READY pending VOID_PENDING, desired next PAUSED
reamer-1.4.1/gst/gstelement.c:2328:gst_element_continue_state:<imxvideoconvert_ipu5> [00m completed state change to PAUSED
reamer-1.4.1/gst/gstelement.c:2233:_priv_gst_element_state_changed:<imxvideoconvert_ipu5> [00m notifying about state-changed READY to PAUSED (VOID_PENDING pending)
reamer-1.4.1/gst/gstbin.c:2673:gst_bin_change_state_func:<avcrecord-pipeline> [00m child 'imxvideoconvert_ipu5' changed state to 3(PAUSED) successfully
mer-1.4.1/libs/gst/base/gstbasetransform.c:2138:gst_base_transform_handle_buffer:<imxvideoconvert_ipu5> [00m warning: not negotiated
mer-1.4.1/libs/gst/base/gstbasetransform.c:2138:gst_base_transform_handle_buffer:<imxvideoconvert_ipu5> [00m warning: not negotiated
gstreamer-1.4.1/gst/gstelement.c:1835:gst_element_message_full:<imxvideoconvert_ipu5> [00m posting message: not negotiated
gstreamer-1.4.1/gst/gstelement.c:1858:gst_element_message_full:<imxvideoconvert_ipu5> [00m posted warning message: not negotiated
reamer-1.4.1/gst/gstbin.c:2230:gst_bin_element_set_state:<imxvideoconvert_ipu5> [00m current PAUSED pending VOID_PENDING, desired next NULL
reamer-1.4.1/gst/gstelement.c:2303:gst_element_continue_state:<imxvideoconvert_ipu5> [00m committing state from PAUSED to READY, pending NULL, next NULL
reamer-1.4.1/gst/gstelement.c:2233:_priv_gst_element_state_changed:<imxvideoconvert_ipu5> [00m notifying about state-changed PAUSED to READY (NULL pending)
reamer-1.4.1/gst/gstelement.c:2310:gst_element_continue_state:<imxvideoconvert_ipu5> [00m continue state change READY to NULL, final NULL

I don't know why the NOT_NEGOTIATED sometimes happen with the record pipeline.

Can anyone give me a hint for it?

0 项奖励
回复