MPEG4 hardware accelerated decoding

Hello,

Are there samples for use with the 00_video_decode example from the nvidia-l4t-jetson-multimedia-api package?
I’m trying to decode a MPEG4 video and can’t get it to work.

As I understand it, the video data should be extracted from the container, so I’ve tried gst-launch-1.0 filesrc location=<video> ! qtdemux name=dmux dmux.video_0 ! queue ! filesink location=vid.mpeg4.
However I get the following error:

Opening in BLOCKING MODE 
NvMMLiteOpen : Block : BlockType = 260 
NVMEDIA: Reading vendor.tegra.display-size : status: 6 
NvMMLiteBlockCreate : Block : BlockType = 260 
Setting frame input mode to 1 
Starting decoder capture loop thread
Input file read complete
[ERROR] (NvV4l2Element.cpp:114) <dec0> Error while DQing event: Invalid argument
Error in dequeueing decoder event
Exiting decoder capture loop thread
[ERROR] (NvV4l2ElementPlane.cpp:178) <dec0> Output Plane:Error while DQing buffer: Broken pipe
Error DQing buffer at output plane
Decoder is in error
App run failed

You may be confusing mp4 container (qt mov is very similar for H264) with MPEG4 video encoding.
You may check what encoding has your video inside mp4 container from Ubuntu (right click on video file, properties, Audio/Video).

It is MPEG-4. Here’s what ffmpeg reports for the video stream: Stream #0:0(jpn): Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 1139 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 24k tbc (default).
Software decoding also works fine on this video.

You may try:

gst-launch-1.0 filesrc location=<video> ! mpeg4videoparse ! nvv4l2decoder ! autovideosink

It seems the video stream wasn’t properly extrated.
Fixed with ffmpeg -i <in> -c:v mpeg4 -pix_fmt yuv420p -an -f h264 test_mpeg4.mpeg4.

Maybe unintuitively, the resulting file does contain a mpeg-4 compressed bitstream, which is accepted by the sample:

$ ./video_decode MPEG4 test_mpeg4.mpeg4                                                             
Set governor to performance before enabling profiler
Creating decoder in blocking mode 
Opening in BLOCKING MODE 
NvMMLiteOpen : Block : BlockType = 260 
NVMEDIA: Reading vendor.tegra.display-size : status: 6 
NvMMLiteBlockCreate : Block : BlockType = 260 
Setting frame input mode to 1 
Input file read complete
Starting decoder capture loop thread
Video Resolution: 426x320
[INFO] (NvEglRenderer.cpp:110) <renderer0> Setting Screen width 426 height 320
Decoder colorspace ITU-R BT.601 with standard range luma (16-235)
Query and set capture successful