To reproduce the issue, apply the patch from above link:
$patch filtering_video.c < h264_nvv4l2dec.patch
Compile the ffmpeg example file, and run the program (filtering_video) on jetson: (test.mp4 is my test video file, you can find the test.mp4 file following the link to the patch. I am not allowed to add more than one link to the post. )
With ffmpeg h264 decoder, 53 frames are produced.
$ ./filtering_video test.mp4
Number of frames decoded: 53
With h264_nvv4l2dec, only 37 frames are produced. The numbers of frames vary with different runs.
$ ./filtering_video test.mp4 nvdec
Opening in BLOCKING MODE
NvMMLiteOpen : Block : BlockType = 261
NVMEDIA: Reading vendor.tegra.display-size : status: 6
NvMMLiteBlockCreate : Block : BlockType = 261
Number of frames decoded: 37
Hi,
For ffmpeg software stack, it would need other users to check and share experience. IF you think it is more like an issue in our low-level sodtware stack, please try to reproduce it with either sample:
We are using ffmpeg libs in our applications. We don’t use the low-level Nvidia API directly.
Is the following ffmpeg implementation supported by Nvidia?
Thanks for the suggestion, DaneLLL.
I extracted the h264 stream and got the following results, which matches my expectations of 55 frames.
./decode_sample test.h264 raw_output
Opening in BLOCKING MODE
NvMMLiteOpen : Block : BlockType = 261
NVMEDIA: Reading vendor.tegra.display-size : status: 6
NvMMLiteBlockCreate : Block : BlockType = 261
Starting capture thread
Input file read complete
Resolution: 240x160
Decoder colorspace ITU-R BT.601 with standard range luma (16-235)
Query and set capture successful
Resource unavailable
Resource unavailable
Exiting decoder capture loop thread
Decoder Run is successful
num_frame_decoded 55
That indicates the low-level API works fine. The problem lies with the integration with ffmpeg decoding framework.
Can you respond to my question above about the support from Nvidia for ffmpeg?
“For ffmpeg software stack, it would need other users to check and share experience.”
I provided the patch for my testing, and it is very easy to reproduce the problem. Can you have someone from Nvidia to take a look?
Other users may not care a few frames lost at the end of the file. But it is critical for our application to get every frame.
Hi,
We do not dedicate to working in ffmpeg, so may not be able to suggest next. For the reason, the code is public so that users can check and share experience to each other.