Sample_vdec on Milk-V Duo 64MB (SDK V1) decodes 0 frames

I am using the original Milk-V Duo 64 MB (CV1800B) with the official Duo Buildroot SDK V1.

I am using the original Milk-V Duo 64MB (CV1800B) with the official Milk-V Duo Buildroot SDK V1.

I am not using Duo S and I am not using SDK V2.

I am trying to test the hardware H.264 decoder using the sample_vdec example provided with SDK V1.

1. Create a raw H.264 test file on Ubuntu

I have a test MP4 file on my Ubuntu PC.

The video is:

H.264 Main
768x432
24 fps
YUV420P

On Ubuntu, I convert the MP4 to a raw H.264 elementary stream:

ffmpeg -i test.mp4 -an -c:v copy -bsf:v h264_mp4toannexb -f h264 test_extracted.264

This successfully creates:

test_extracted.264

I then copy this file to the Milk-V Duo:

scp test_extracted.264 root@<DUO_IP>:/root/

On the Duo:

ls -lh /root/test_extracted.264

The file is present.

  1. Run sample_vdec on the Duo

I am using the sample_vdec executable from the SDK V1 examples.

On the Duo, I run:

./sample_vdec --numChn=1 --chn=0 -c 264 -i test_extracted.264 -o dump.yuv

Output:

./sample_vdec
 ---------------------------------------------------------------------------------------------------
 chn:0, Type:0, bStart:0, DecodeFrames:0, LeftPics:0,LeftBytes:0, LeftFrames:0, RecvFrames:0  
 FormatErr:0,  s32PicSizeErrSet:0,  s32StreamUnsprt:0,s32PackErr:0,  u32PrtclNumErrSet:0,  s32RefErrSet:0,  s32PicBufSizeErrSet:0  
 ---------------------------------------------------------------------------------------------------

There is no error message, but:

DecodeFrames:0
RecvFrames:0

and no useful dump.yuv output is produced.

I also tried another H.264 elementary stream:

./sample_vdec --numChn=1 --chn=0 -c 264 -i test_hardware_ready.264 -o /dev/null

Result:

./sample_vdec
 ---------------------------------------------------------------------------------------------------
 chn:0, Type:0, bStart:0, DecodeFrames:0, LeftPics:0,LeftBytes:0, LeftFrames:0, RecvFrames:0  
 FormatErr:0,  s32PicSizeErrSet:0,  s32StreamUnsprt:0,s32PackErr:0,  u32PrtclNumErrSet:0,  s32RefErrSet:0,  s32PicBufSizeErrSet:0  
 ---------------------------------------------------------------------------------------------------

I also tried specifying the frame buffer dimensions explicitly:

./sample_vdec --numChn=1 --chn=0 -c 264 -i test_hardware_ready.264 -o /dev/null --bufwidth=768 --bufheight=432

The result is still:

DecodeFrames:0
RecvFrames:0

with no decoding error reported.

Environment

  • Board: Milk-V Duo 64 MB
  • SoC: CV1800B
  • SDK: Milk-V Duo Buildroot SDK V1
  • Input: H.264 elementary stream (.264)
  • Resolution: 768×432
  • Pixel format of source: YUV420P
  • Decoder example: sample_vdec

Question

Is there any additional initialization, kernel driver, firmware, environment variable, or configuration required for the CV1800B hardware VDEC to work with sample_vdec on the 64 MB Milk-V Duo using SDK V1?

Is sample_vdec expected to work directly on the standard SDK V1 image, or is there a specific VDEC configuration that needs to be enabled?

I would especially appreciate guidance from someone who has successfully run sample_vdec on the 64 MB Duo / CV1800B with SDK V1.

Thanks
Jags