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.

SK-AM69: Encode 4K .mp4 to H.265

Part Number: SK-AM69

Customer verify Video encode/decode feature on SK-AM69 board with .mp4 file, it is ok to do H.264/H.265 with 2K resolution .mp4 file.

But with 4K .mp4 file, report erro as below:

gst-launch-1.0 filesrc location=./20240229095126003_000.mp4 ! qtdemux name=demuxer demuxer.! h265parse ! queue ! v4l2h265dec  ! autovideosink

  • Hello, 

    What SDK version is this referencing?

    Thanks,
    Sarabesh S.

  • Hello,

    Thanks, what is the full resolution of the stream (length*width)? Also could you try the pipeline like this: 

    • gst-launch-1.0 filesrc location=<input_file.mp4> ! qtdemux ! h265parse ! queue ! v4l2h265dec  ! autovideosink

    Is there a space in your pipeline between qtdemux plugin and the "! h265parse"?

    Could you also provide me with the .mp4 stream to test?

    Thank You,
    Sarabesh S.

  • Hello,

    It is 3840x2160, sent the .mp4 file offline.

  • Hi Tony,

    I am in trainings till Friday, so will not be able to test the stream this week. Thanks for your patience.

    Best,
    Sarabesh S.

  • Hi, Sarabesh

    Do you have time to test?

  • Hi Tony, 

    I believe there may be some limitation with the qtdemux plugin. I was able to successfully decode with 720p and 1080p but the provided 4k stream fails. I will test with another 4k stream and let you know the results. 

    Thank You,
    Sarabesh S. 

  • Hi Tony,

    I believe this problem may be with the color parameter of the stream. In general what is the encoding process that you are using to get this stream? What camera is being used for the capture and do you know if the stream is encoded with 10-bit color depth? The stream has a color parameter of bt2020 which suggests that it being encoded with 10-bit or 12-bit color depth. Our IP only supports 8-bit color and I haven't had any success overwriting this bt2020 color parameter for a successful decode.

    Thank You,
    Sarabesh S.

  • Sarabesh,

    The bit depth is 8bit. 

    Can you share a 4K video file for customer to verify?

    root@localhost:~/xingcl# mediainfo 20240229095126003_000.mp4 
    
    General
    
    Complete name                            : 20240229095126003_000.mp4
    
    Format                                   : MPEG-4
    
    Format profile                           : Base Media / Version 2
    
    Codec ID                                 : mp42 (mp42/mp41/isom/iso2)
    
    File size                                : 24.3 MiB
    
    Duration                                 : 5 s 117 ms
    
    Overall bit rate                         : 39.9 Mb/s
    
    Encoded date                             : UTC 2024-02-29 09:51:27
    
    Tagged date                              : UTC 2024-02-29 09:51:32
    
     
    
    Video
    
    ID                                       : 1
    
    Format                                   : HEVC
    
    Format/Info                              : High Efficiency Video Coding
    
    Format profile                           : Main@L5.1@Main
    
    Codec ID                                 : hvc1
    
    Codec ID/Info                            : High Efficiency Video Coding
    
    Duration                                 : 5 s 117 ms
    
    Bit rate                                 : 39.9 Mb/s
    
    Maximum bit rate                         : 65.2 Mb/s
    
    Width                                    : 3 840 pixels
    
    Height                                   : 2 160 pixels
    
    Display aspect ratio                     : 16:9
    
    Frame rate mode                          : Variable
    
    Frame rate                               : 60.000 FPS
    
    Minimum frame rate                       : 51.724 FPS
    
    Maximum frame rate                       : 71.429 FPS
    
    Color space                              : YUV
    
    Chroma subsampling                       : 4:2:0 (Type 0)
    
    Bit depth                                : 8 bits
    
    Bits/(Pixel*Frame)                       : 0.080
    
    Stream size                              : 24.3 MiB (100%)
    
    Encoded date                             : UTC 2024-02-29 09:51:27
    
    Tagged date                              : UTC 2024-02-29 09:51:32
    
    Color range                              : Limited
    
    Color primaries                          : BT.2020
    
    Matrix coefficients                      : BT.2020 non-constant
    
    Codec configuration box                  : hvcC

    The 1080P file information as below which can pass encoding test.

    root@localhost:~/xingcl# mediainfo 20231115_170107_002_000.mp4 
    General
    Complete name                            : 20231115_170107_002_000.mp4
    Format                                   : MPEG-4
    Format profile                           : Base Media / Version 2
    Codec ID                                 : mp42 (mp42/mp41/isom/iso2)
    File size                                : 314 MiB
    Duration                                 : 6 min 25 s
    Overall bit rate mode                    : Variable
    Overall bit rate                         : 6 831 kb/s
    Encoded date                             : UTC 2023-11-15 09:01:07
    Tagged date                              : UTC 2023-11-15 09:07:33
    
    Video
    ID                                       : 1
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format profile                           : Baseline@L4
    Format settings                          : 1 Ref Frames
    Format settings, CABAC                   : No
    Format settings, Reference frames        : 1 frame
    Format settings, GOP                     : M=1, N=30
    Codec ID                                 : avc1
    Codec ID/Info                            : Advanced Video Coding
    Duration                                 : 6 min 25 s
    Bit rate mode                            : Variable
    Bit rate                                 : 6 829 kb/s
    Maximum bit rate                         : 8 000 kb/s
    Width                                    : 1 920 pixels
    Height                                   : 1 080 pixels
    Display aspect ratio                     : 16:9
    Frame rate mode                          : Variable
    Frame rate                               : 29.970 (29970/1000) FPS
    Minimum frame rate                       : 29.703 FPS
    Maximum frame rate                       : 30.303 FPS
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Bits/(Pixel*Frame)                       : 0.110
    Stream size                              : 314 MiB (100%)
    Encoded date                             : UTC 2023-11-15 09:01:07
    Tagged date                              : UTC 2023-11-15 09:07:33
    Color range                              : Limited
    Color primaries                          : BT.709
    Transfer characteristics                 : BT.709
    Matrix coefficients                      : BT.709
    Codec configuration box                  : avcC
    

  • Hi Tony, 

    Sure attached is the HEVC 4K mp4 file that was successfully decoded. Additionally, I will follow up with our IP vendor to determine any limitations/requirements on color range. 
    /cfs-file/__key/communityserver-discussions-components-files/791/bbb4k60_5F00_hevc.mp4

    Regards,
    Sarabesh S.

  • Hi Tony,

    Is it ok if I share the camera capture MP4, you gave me to test, with our IP vendor?

    Regards,
    Sarabesh S.

  • It is OK to share the .mp4 file.

  • Sounds good. Will update you with any findings.

    Regards,
    Sarabesh S.

  • Hi Tony, 

    Were you able to successfully decode the HEVC 4k MP4 file that I provided in the customer's environment?

    Regards,
    Sarabesh S.

  • Yes,.

    So the problem is bt2020 format?

  • Hi Tony, 

    Please expect delay in response as Sarabesh is traveling for business this week. 

    Thanks,

    Brandon

  • Hi Tony, 

    We have root caused the issue and it is due to the video format. However, this is not a driver issue. It is a gstreamer v4l2 plugin limitation. The driver has the capability to support bt2020, but the plugin itself does not expose this capability which is why you are seeing this linking error. 

    The colorimetry code being exposed by qtdemux is colorimetry=(string)2:6:0:7 whereas the list of supported colorimetry by the v4l2 plugin is colorimetry=(string){ bt601, smpte240m, bt709, 1:3:5:1, 2:4:5:2, 2:4:5:3, 1:4:7:1, 2:4:7:1, 2:4:12:8, bt2020, 2:0:0:0 }. qtdemux is setting a certain colorimetry on the src pad that the downstream elements don't have support for, therefore linking will fail. To be clear though, this list of supported colorimetry is not coming from the driver, but the gstreamer plugin itself. 

    Best,

    Brandon