Video decoder issue

Hi, I am having issue with video decoder on Orin. With either the working code I have for Xavier or the 00-video-decoder sample provided in the SDK, there are issues.

Here is an output of running the sample:

verdant@orin:~/verdant/jetson_multimedia_api/samples/00_video_decode$ ./video_decode H265 --disable-rendering  test001.mp4
Set governor to performance before enabling profiler
Creating decoder in blocking mode
Opening in BLOCKING MODE
NvMMLiteOpen : Block : BlockType = 279
NVMEDIA: Reading vendor.tegra.display-size : status: 6
NvMMLiteBlockCreate : Block : BlockType = 279
Setting frame input mode to 1
Input file read complete
Starting decoder capture loop thread
Got EoS at output plane
[ERROR] (NvV4l2Element.cpp:114) <dec0> Error while DQing event: Invalid argument
Error in dequeueing decoder event
Exiting decoder capture loop thread
App run failed

I am using a small sample h265 Mp4 video.

Hi,
You would need to run the sample with h264/h265 stream. Please run ffmpeg command to extract the h265 stream:

$ ./ffmpeg -i test001.mp4 -vcodec copy -f rawvideo test001.265

Hi Dane,

I tried this and it still did not work. First, I did the conversion as you specified:

verdant@orin:~/verdant/dev/third_party/vid/tests/testdata (law/orindev)$ ffmpeg -i test001.mp4 -vcodec copy -f rawvideo test001.265
ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.3.0-10ubuntu2)
  configuration: --prefix=/usr --extra-version=1ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/aarch64-linux-gnu --incdir=/usr/include/aarch64-linux-gnu --arch=arm64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test001.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    encoder         : Lavf58.29.100
  Duration: 00:00:00.27, start: 0.000000, bitrate: 28715 kb/s
    Stream #0:0(und): Video: hevc (Main) (hvc1 / 0x31637668), yuv420p(tv), 1024x768 [SAR 1:1 DAR 4:3], 28698 kb/s, 240 fps, 240 tbr, 90k tbn, 240 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Output #0, rawvideo, to 'test001.265':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    encoder         : Lavf58.29.100
    Stream #0:0(und): Video: hevc (Main) (hvc1 / 0x31637668), yuv420p(tv), 1024x768 [SAR 1:1 DAR 4:3], q=2-31, 28698 kb/s, 240 fps, 240 tbr, 240 tbn, 240 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
frame=   65 fps=0.0 q=-1.0 Lsize=     949kB time=00:00:00.27 bitrate=28698.6kbits/s speed= 213x    
video:949kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000%

Next, I tried using this new file on the decode work:

verdant@orin:~/verdant/jetson_multimedia_api/samples/00_video_decode$ ./video_decode H265 --disable-rendering ~/verdant/dev/third_party/vid/tests/testdata/test001.265 
Set governor to performance before enabling profiler
Creating decoder in blocking mode 
Opening in BLOCKING MODE 
NvMMLiteOpen : Block : BlockType = 279 
NVMEDIA: Reading vendor.tegra.display-size : status: 6 
NvMMLiteBlockCreate : Block : BlockType = 279 
Setting frame input mode to 1 
Input file read complete
Starting decoder capture loop thread
Got EoS at output plane
[ERROR] (NvV4l2Element.cpp:114) <dec0> Error while DQing event: Invalid argument
Error in dequeueing decoder event
Exiting decoder capture loop thread
App run failed

For reference, attaching the .265 file here.
test001.265 (948.8 KB)

Hi,
The stream looks invalid. We cannot decode it through software decoder:

nvidia@tegra-ubuntu:~$ gst-launch-1.0 filesrc location= test001.265 ! h265parse ! avdec_h265 ! filesink location=a.yuv
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
ERROR: from element /GstPipeline:pipeline0/GstH265Parse:h265parse0: No valid frames found before end of stream
Additional debug info:
gstbaseparse.c(3625): gst_base_parse_loop (): /GstPipeline:pipeline0/GstH265Parse:h265parse0
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...

Please attached test001.mp4 for reference.

Here is test001.mp4 for reference.

Hi,
Somehow we are not able to access test001.mp4. Please re-upload it again.

re-uploading, with a different name in case that was the issue.

Hi,
Are you able to zip it and upload? Somehow we still cannot download it.

This issue has been fixed, our video decoding code was still using nvbuf_utils primitives, while everything else in the codebase had moved to nvbufsurface.

1 Like

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