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.

Linux/AM5718: 1920x1200 Encoding

Part Number: AM5718

Tool/software: Linux

Hi,

I am using AM571x Industrial Development kit and linux SDK 05.01.00.11. I am trying to encode 1920x1200 video.

Below is the gstreamer command I am using:

# gst-launch-1.0  v4l2src device=/dev/video1 io-mode=4 \
! 'video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)720, framerate=(fraction)60/1' \
! vpe num-input-buffers=16 \
! 'video/x-raw, format=(string)NV12, width=(int)1920, height=(int)1200, framerate=(fraction)30/1' \
! ducatih264enc bitrate=10000 \
! filesink location=/home/root/1200_1.h264

I am capturing 720p video. Upscaling it to 1920x1200. Then trying to encode the video. I am getting following error;

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
ERROR: from element /GstPipeline:pipeline0/GstDucatiH264Enc:ducatih264enc0: Could not encode stream.
Additional debug info:
gstducatividenc.c(752): gst_ducati_videnc_handle_frame (): /GstPipeline:pipeline0/GstDucatiH264Enc:ducatih264enc0
Execution ended after 0:00:00.137288063
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

But I am able to display it properly using following command:

gst-launch-1.0 -v v4l2src device=/dev/video1 io-mode=4 \
! 'video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)720, framerate=(fraction)60/1' \
! vpe num-input-buffers=16 \
! 'video/x-raw, format=(string)NV12, width=(int)1920, height=(int)1200, framerate=(fraction)30/1' \
! kmssink

From this I know VPE and DSS is capable of handling 1920x1200. Is there any issue with command or encoder will not support 1920x1200 ?

Regards,

Pranay kumar

  • Hello Pranay Kumar,

    kashetty pranay kumar said:
    # gst-launch-1.0  v4l2src device=/dev/video1 io-mode=4 \
    ! 'video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)720, framerate=(fraction)60/1' \
    ! vpe num-input-buffers=16 \
    ! 'video/x-raw, format=(string)NV12, width=(int)1920, height=(int)1200, framerate=(fraction)30/1' \
    ! ducatih264enc bitrate=10000 \
    ! filesink location=/home/root/1200_1.h264

    1. VPE can not perform frame rate conversion. VPE can be used only for scaling, csc and deinterlacing.

    But gstreamer framework has element called videorate which could be used for this.
    You could find more information about videorate here:

    https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-plugins/html/gst-plugins-base-plugins-videorate.html

    There are videorate examples in the link .

    2. Because of 1. the input of the encoder is 60fps not 30fps so you must set few additional encoder properties.

    ... ! ducatih264enc level=level-51 profile=high ! ...

    BR
    Margarita

  • Hi Margarita,

    Is there any way I can confirm frame rate received from camera. I am giving capsfilter as 60. When I encode directly to 720. The encoded file is saying frame rate is 30. Is there any command to know the incoming frame rate correctly ?

    Regards,
    Pranay
  • Hello,

    Try with yavta and see what is the fps that it reports.

    yavta -c20 -fNV12 -F/dev/null -s1920x1080 /dev/video1

    Change the format, resolution depending of your use case.

    BR
    Margarita

  • Hi,

    Based on the yavta command's output:

    # yavta -c29 -fNV12 -F/dev/null -s1280x720 /dev/video1

    0 (0) [-] top 0 1382400 B 10363.596196 10363.596227 14.984 fps ts mono/EoF
    1 (1) [-] top 1 1382400 B 10363.630465 10363.630516 29.181 fps ts mono/EoF
    2 (2) [-] top 2 1382400 B 10363.664728 10363.664757 29.186 fps ts mono/EoF
    3 (3) [-] top 3 1382400 B 10363.698995 10363.699025 29.183 fps ts mono/EoF
    4 (4) [-] top 4 1382400 B 10363.733265 10363.733314 29.180 fps ts mono/EoF
    5 (5) [-] top 5 1382400 B 10363.767528 10363.767555 29.186 fps ts mono/EoF
    6 (6) [-] top 6 1382400 B 10363.801795 10363.801824 29.183 fps ts mono/EoF
    7 (7) [-] top 7 1382400 B 10363.836061 10363.836104 29.183 fps ts mono/EoF
    8 (0) [-] top 8 1382400 B 10363.870331 10363.870364 29.180 fps ts mono/EoF
    9 (1) [-] top 9 1382400 B 10363.904594 10363.904623 29.186 fps ts mono/EoF
    10 (2) [-] top 10 1382400 B 10363.938861 10363.938892 29.183 fps ts mono/EoF
    11 (3) [-] top 11 1382400 B 10363.973131 10363.973164 29.180 fps ts mono/EoF
    12 (4) [-] top 12 1382400 B 10364.007394 10364.007449 29.186 fps ts mono/EoF
    13 (5) [-] top 13 1382400 B 10364.041664 10364.041697 29.180 fps ts mono/EoF
    14 (6) [-] top 14 1382400 B 10364.075927 10364.075973 29.186 fps ts mono/EoF
    15 (7) [-] top 15 1382400 B 10364.110194 10364.110222 29.183 fps ts mono/EoF
    16 (0) [-] top 16 1382400 B 10364.144460 10364.144491 29.183 fps ts mono/EoF
    17 (1) [-] top 17 1382400 B 10364.178727 10364.178771 29.183 fps ts mono/EoF
    18 (2) [-] top 18 1382400 B 10364.212994 10364.213023 29.183 fps ts mono/EoF
    19 (3) [-] top 19 1382400 B 10364.247260 10364.247286 29.183 fps ts mono/EoF
    20 (4) [-] top 20 1382400 B 10364.281530 10364.281577 29.180 fps ts mono/EoF
    21 (5) [-] top 21 1382400 B 10364.315794 10364.315821 29.185 fps ts mono/EoF
    22 (6) [-] top 22 1382400 B 10364.350063 10364.350109 29.181 fps ts mono/EoF
    23 (7) [-] top 23 1382400 B 10364.384326 10364.384356 29.186 fps ts mono/EoF
    24 (0) [-] top 24 1382400 B 10364.418593 10364.418621 29.183 fps ts mono/EoF
    25 (1) [-] top 25 1382400 B 10364.452863 10364.452910 29.180 fps ts mono/EoF
    26 (2) [-] top 26 1382400 B 10364.487126 10364.487154 29.186 fps ts mono/EoF
    27 (3) [-] top 27 1382400 B 10364.521393 10364.521441 29.183 fps ts mono/EoF
    28 (4) [-] top 28 1382400 B 10364.555660 10364.555702 29.183 fps ts mono/EoF

    It is capturing 720p video at 30fps.

    I have modified my upscale and encode command to as follows:

    gst-launch-1.0 v4l2src device=/dev/video1 io-mode=4 \
    ! 'video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)720, framerate=(fraction)30/1' \
    ! vpe num-input-buffers=16 \
    ! 'video/x-raw, format=(string)NV12, width=(int)1920, height=(int)1200, framerate=(fraction)30/1' \
    ! ducatih264enc bitrate=10000 \
    ! filesink location=/home/root/1200_1.h264

    Still I am facing same encode issue:

    ERROR: from element /GstPipeline:pipeline0/GstDucatiH264Enc:ducatih264enc0: Could not encode stream.
    Additional debug info:
    gstducatividenc.c(752): gst_ducati_videnc_handle_frame (): /GstPipeline:pipeline0/GstDucatiH264Enc:ducatih264enc0

    I even tried in with 29 frame rate. Still same observation.

    Regards,

    Pranay

  • Hello,

    Please check my fist answer.
    Add ... ! ducatih264enc level=51 ! ...
  • Hello,


    gst-launch-1.0 v4l2src device=/dev/video1 io-mode=4 \
    ! 'video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)720, framerate=(fraction)30/1' \
    ! vpe num-input-buffers=16 \
    ! 'video/x-raw, format=(string)NV12, width=(int)1920, height=(int)1080, framerate=(fraction)30/1' \
    ! ducatih264enc level=51 bitrate=10000 \
    ! filesink location=/home/root/1200_1.h264

    Is this working?
    I guess you have checked this file:
    psdk/board-support/linux-4.14.40+gitAUTOINC+4796173fc5-g4796173fc5/drivers/media/platform/ti-vpe
    vpdma.h
    where
    enum vpdma_max_height {
    ...
    MAX_OUT_HEIGHT_1080,
    };


    You could try this:
    gst-launch-1.0 v4l2src device=/dev/video1 io-mode=4 \
    ! 'video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)720, framerate=(fraction)30/1' \
    ! videoscale \
    ! 'video/x-raw, format=(string)NV12, width=(int)1920, height=(int)1080, framerate=(fraction)30/1' \
    ! ducatih264enc level=51 bitrate=10000 \
    ! filesink location=/home/root/1200_1.h264

    BR
    Margarita
  • Hi Margarita,

    This solved my problem. My requirement is of 1920x1200 encode. By adding level and profile to the command worked. I am able to encode 1920x1200 and write to file. My final command is:

    gst-launch-1.0 v4l2src device=/dev/video1 io-mode=4 \
    ! 'video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)720, framerate=(fraction)30/1' \
    ! vpe num-input-buffers=16 \
    ! 'video/x-raw, format=(string)NV12, width=(int)1920, height=(int)1200, framerate=(fraction)30/1' \
    ! ducatih264enc bitrate=5000 level=level-51 profile=high \
    ! filesink location=/home/root/1200_1.h264

    Thanks and Regards,
    Pranay kumar
  • Hello,

    I am glad that this issue is solved.
    Thank you !

    BR
    Margarita