00_video_decode with x264 encoded stream fails

Is there anything preventing an x264-encoded bitstream from being decoded? I’m generating an x264-encoded bitstream via ffmpeg:

$ ffmpeg -f lavfi -i testsrc=duration=5 -c:v libx264 -f h264 test.h264

Then decoding it with 00_video_decode:

$ ./video_decode H264 --disable-rendering -o ~/test.yuv ~/test.h264
Set governor to performance before enabling profiler
Creating decoder in blocking mode 
NvMMLiteOpen : Block : BlockType = 261 
NVMEDIA: Reading vendor.tegra.display-size : status: 6 
NvMMLiteBlockCreate : Block : BlockType = 261 
Setting frame input mode to 1 
Input file read complete
Starting decoder capture loop thread
[NvMediaParserParse:357] Video parser parse failed: 0[NvMediaParserParse:357] Video parser parse failed: 0Got EoS at output plane
[ERROR] (NvV4l2Element.cpp:115) <dec0> Error while DQing event: Invalid argument
Error in dequeueing decoder event
Exiting decoder capture loop thread
App run failed

Not sure why it’s failing to parse. The sample, of course, works if I use NvVideoEncoder to generate the video. Similarly,

$ gst-launch-1.0 filesrc location=test.h264 ! h264parse ! avdec_h264 ! fakesink

has no issues playing the file.

Ah, ok apparently it’s because the default pix format on ffmpeg-configured x264 is yuv444p which isn’t supported by the decoder? If I generate the file with

ffmpeg -f lavfi -i testsrc=duration=5 -pix_fmt yuv420p -c:v libx264 -f h264 test.h264

it works correctly. Why is that?

Decoding YUV444 stream is not supported on Jetson Nano. Please encode the stream from YUV420 data.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.