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.

[TDA4VM] V4L2 test application error



Hi, TI team members

I tried V4L2 Video Encoder Test Application by reading guidance. (https://software-dl.ti.com/jacinto7/esd/processor-sdk-linux-jacinto7/08_02_00_03/exports/docs/linux/Foundational_Components_Multimedia_D5520_VXE384.html)

When I ran ' tienc_encode -i 0000000000.yuv -f NV12 -c H264 -w 640 -h 480 -o video.h264', logs are below.

root@j7-evm:/run/media/sda1/dump# tienc_encode -i 0000000000.yuv -f NV12 -c H264 -w 640 -h 480 -o video.h264
query_ctrls Enumerating all non-compound
query_ctrls Got ctrl.id=0x9909cb type=1
query_ctrls     name=GOP size minimum=1 maximum=7200
query_ctrls     step=1 default_value=1800
query_ctrls     flags=00000000
query_ctrls Got ctrl.id=0x9909cf type=1
query_ctrls     name=Video Bitrate minimum=50000 maximum=100000000
query_ctrls     step=1 default_value=500000
query_ctrls     flags=00000000
query_ctrls Got ctrl.id=0x990a66 type=1
query_ctrls     name=H264 I period minimum=1 maximum=600
query_ctrls     step=1 default_value=30
query_ctrls     flags=00000000
query_ctrls Enumerating all non-compound ended errno=22 Invalid argument
query_ctrls Enumerating all non-compound ext
query_ctrls Got ext_ctrl.id=0x9909cb type=1
query_ctrls     name=GOP size minimum=1 maximum=7200
query_ctrls     step=1 default_value=1800
query_ctrls     elem_size=4 elems=1 nr_of_dims=0
query_ctrls     flags=00000000
query_ctrls Got ext_ctrl.id=0x9909cf type=1
query_ctrls     name=Video Bitrate minimum=50000 maximum=100000000
query_ctrls     step=1 default_value=500000
query_ctrls     elem_size=4 elems=1 nr_of_dims=0
query_ctrls     flags=00000000
query_ctrls Got ext_ctrl.id=0x990a66 type=1
query_ctrls     name=H264 I period minimum=1 maximum=600
query_ctrls     step=1 default_value=30
query_ctrls     elem_size=4 elems=1 nr_of_dims=0
query_ctrls     flags=00000000
query_ctrls Enumerating all non-compound ext ended errno=22 Invalid argument
query_ctrls Enumerating all compound ext
query_ctrls Enumerating all compound ext ended errno=22 Invalid argument
query_ctrls Enumerating all controls ext
query_ctrls Got ext_ctrl.id=0x9909cb type=1
query_ctrls     name=GOP size minimum=1 maximum=7200
query_ctrls     step=1 default_value=1800
query_ctrls     elem_size=4 elems=1 nr_of_dims=0
query_ctrls     flags=00000000
query_ctrls Got ext_ctrl.id=0x9909cf type=1
query_ctrls     name=Video Bitrate minimum=50000 maximum=100000000
query_ctrls     step=1 default_value=500000
query_ctrls     elem_size=4 elems=1 nr_of_dims=0
query_ctrls     flags=00000000
query_ctrls Got ext_ctrl.id=0x990a66 type=1
query_ctrls     name=H264 I period minimum=1 maximum=600
query_ctrls     step=1 default_value=30
query_ctrls     elem_size=4 elems=1 nr_of_dims=0
query_ctrls     flags=00000000
query_ctrls Enumerating all controls ext ended errno=22 Invalid argument
query_ctrls Got ctrl.id=0x9909cb type=1
query_ctrls     name=GOP size minimum=1 maximum=7200
query_ctrls     step=1 default_value=1800
query_ctrls     flags=00000000
query_ctrls Got ctrl.id=0x9909cf type=1
query_ctrls     name=Video Bitrate minimum=50000 maximum=100000000
query_ctrls     step=1 default_value=500000
query_ctrls     flags=00000000
query_ctrls Got ctrl.id=0x990a66 type=1
query_ctrls     name=H264 I period minimum=1 maximum=600
query_ctrls     step=1 default_value=30
query_ctrls     flags=00000000
query_ctrls Got ext_ctrl.id=0x9909cb type=1
query_ctrls     name=GOP size minimum=1 maximum=7200
query_ctrls     step=1 default_value=1800
query_ctrls     elem_size=4 elems=1 nr_of_dims=0
query_ctrls     flags=00000000
query_ctrls Got ext_ctrl.id=0x9909cf type=1
query_ctrls     name=Video Bitrate minimum=50000 maximum=100000000
query_ctrls     step=1 default_value=500000
query_ctrls     elem_size=4 elems=1 nr_of_dims=0
query_ctrls     flags=00000000
query_ctrls Got ext_ctrl.id=0x990a66 type=1
query_ctrls     name=H264 I period minimum=1 maximum=600
query_ctrls     step=1 default_value=30
query_ctrls     elem_size=4 elems=1 nr_of_dims=0
query_ctrls     flags=00000000
try_ctrls VIDIOC_TRY_EXT_CTRLS succeeded
set_ctrls VIDIOC_S_EXT_CTRLS succeeded

^C
root@j7-evm:/run/media/sda1/dump# ls -al
total 2560
drwxrwxrwx 1 root root 524288 Mar 23 21:14 .
drwxrwxrwx 1 root root 524288 Jan  1  1970 ..
-rwxrwxrwx 1 root root 460800 Mar 23 20:52 0000000000.yuv
drwxrwxrwx 1 root root 524288 Mar  8 19:38 separate
drwxrwxrwx 1 root root 524288 Mar  8 19:38 topview
-rwxrwxrwx 1 root root      0 Mar 23 21:14 video.h264

Also, I used PSDK8.2.

I was wondering If I missed something like a patch.

Best regards

Yongsig.

  • Hi Yongsig,

    I suspect that it could be an issue with the directory you are working with.

    root@j7-evm:/run/media/sda1/dump This directory is a mount one, The write permissions might not be present.

    Could you check on a normal home directory and see if it works?
    If it works, could you send the input file you are using (YUV file) to reproduce that at our end?

    Regards,
    Nikhil


  • Hi Nikhil

    Thanks for your reply.

    I tried in a regular home directory. But it's failed. The logs were the same as before.

    drwx------ 3 root root   4096 Mar 23 20:56 .
    drwxr-xr-x 3 root root   4096 Mar 23  2022 ..
    -rw------- 1 root root   6410 Mar 23  2022 .bash_history
    drwxr-xr-x 3 root root   4096 Mar 23 20:52 .cache
    -rwxrwxrwx 1 root root 460800 Mar 23 20:52 0000000000.yuv
    root@j7-evm:~# tienc_encode -i 0000000000.yuv -w 640 -h 480 -o test.h264
    No format found. Defaulting to NV12
    No format found. Defaulting to H264
    query_ctrls Enumerating all non-compound
    query_ctrls Got ctrl.id=0x9909cb type=1
    query_ctrls     name=GOP size minimum=1 maximum=7200
    query_ctrls     step=1 default_value=1800
    query_ctrls     flags=00000000
    query_ctrls Got ctrl.id=0x9909cf type=1
    query_ctrls     name=Video Bitrate minimum=50000 maximum=100000000
    query_ctrls     step=1 default_value=500000
    query_ctrls     flags=00000000
    query_ctrls Got ctrl.id=0x990a66 type=1
    query_ctrls     name=H264 I period minimum=1 maximum=600
    query_ctrls     step=1 default_value=30
    query_ctrls     flags=00000000
    query_ctrls Enumerating all non-compound ended errno=22 Invalid argument
    query_ctrls Enumerating all non-compound ext
    query_ctrls Got ext_ctrl.id=0x9909cb type=1
    query_ctrls     name=GOP size minimum=1 maximum=7200
    query_ctrls     step=1 default_value=1800
    query_ctrls     elem_size=4 elems=1 nr_of_dims=0
    query_ctrls     flags=00000000
    query_ctrls Got ext_ctrl.id=0x9909cf type=1
    query_ctrls     name=Video Bitrate minimum=50000 maximum=100000000
    query_ctrls     step=1 default_value=500000
    query_ctrls     elem_size=4 elems=1 nr_of_dims=0
    query_ctrls     flags=00000000
    query_ctrls Got ext_ctrl.id=0x990a66 type=1
    query_ctrls     name=H264 I period minimum=1 maximum=600
    query_ctrls     step=1 default_value=30
    query_ctrls     elem_size=4 elems=1 nr_of_dims=0
    query_ctrls     flags=00000000
    query_ctrls Enumerating all non-compound ext ended errno=22 Invalid argument
    query_ctrls Enumerating all compound ext
    query_ctrls Enumerating all compound ext ended errno=22 Invalid argument
    query_ctrls Enumerating all controls ext
    query_ctrls Got ext_ctrl.id=0x9909cb type=1
    query_ctrls     name=GOP size minimum=1 maximum=7200
    query_ctrls     step=1 default_value=1800
    query_ctrls     elem_size=4 elems=1 nr_of_dims=0
    query_ctrls     flags=00000000
    query_ctrls Got ext_ctrl.id=0x9909cf type=1
    query_ctrls     name=Video Bitrate minimum=50000 maximum=100000000
    query_ctrls     step=1 default_value=500000
    query_ctrls     elem_size=4 elems=1 nr_of_dims=0
    query_ctrls     flags=00000000
    query_ctrls Got ext_ctrl.id=0x990a66 type=1
    query_ctrls     name=H264 I period minimum=1 maximum=600
    query_ctrls     step=1 default_value=30
    query_ctrls     elem_size=4 elems=1 nr_of_dims=0
    query_ctrls     flags=00000000
    query_ctrls Enumerating all controls ext ended errno=22 Invalid argument
    query_ctrls Got ctrl.id=0x9909cb type=1
    query_ctrls     name=GOP size minimum=1 maximum=7200
    query_ctrls     step=1 default_value=1800
    query_ctrls     flags=00000000
    query_ctrls Got ctrl.id=0x9909cf type=1
    query_ctrls     name=Video Bitrate minimum=50000 maximum=100000000
    query_ctrls     step=1 default_value=500000
    query_ctrls     flags=00000000
    query_ctrls Got ctrl.id=0x990a66 type=1
    query_ctrls     name=H264 I period minimum=1 maximum=600
    query_ctrls     step=1 default_value=30
    query_ctrls     flags=00000000
    query_ctrls Got ext_ctrl.id=0x9909cb type=1
    query_ctrls     name=GOP size minimum=1 maximum=7200
    query_ctrls     step=1 default_value=1800
    query_ctrls     elem_size=4 elems=1 nr_of_dims=0
    query_ctrls     flags=00000000
    query_ctrls Got ext_ctrl.id=0x9909cf type=1
    query_ctrls     name=Video Bitrate minimum=50000 maximum=100000000
    query_ctrls     step=1 default_value=500000
    query_ctrls     elem_size=4 elems=1 nr_of_dims=0
    query_ctrls     flags=00000000
    query_ctrls Got ext_ctrl.id=0x990a66 type=1
    query_ctrls     name=H264 I period minimum=1 maximum=600
    query_ctrls     step=1 default_value=30
    query_ctrls     elem_size=4 elems=1 nr_of_dims=0
    query_ctrls     flags=00000000
    try_ctrls VIDIOC_TRY_EXT_CTRLS succeeded
    set_ctrls VIDIOC_S_EXT_CTRLS succeeded
    

    I don't think there is a problem with the permissions.

    I attached the yuv file.

    0000000000.zip

    Regards

    Yongsig

  • Hi Nikhil

    I downloaded the source code of tienc_encode from https://git.ti.com/cgit/jacinto7_multimedia/

    So I fixed some code, for example, I disabled to the 842nd line from the 716th line in main.c

    Then, ret value which is from poll(&pfd, 1, 100) in streaming_loop module is always 0.

    Do you know the reason?

    Best regards

    Yongsig

  • Hi Yongsig,

    You are seeing the above because in the tienc_encode framework, we expect multiple frames (i.e. more than 1) in order to begin encoding.


    You could refer the function below

    https://git.ti.com/cgit/jacinto7_multimedia/videnc-test-app/tree/main.c?id=a5e7d820bea1be24f25a8369d4d4521c784f869a#n124

    Hence could you try providing few more frames inorder to encode this?

    Another way to encode a single image is to use gstreamer as shown below

    gst-launch-1.0 filesrc location=./0000000000.yuv blocksize=460800 ! video/x-raw, format=NV12, width=640, height=480, framerate=30/1, interlace-mode=progressive, colorimetry=bt601 ! v4l2h264enc ! h264parse ! filesink location=./video_gst.264

    Regards,
    Nikhil

  • It works if I use multiple frames.

    Thank Nikhil.