Failed to play mp4(H.264)

I tried to play the following media file by default video application of Ubuntu(Jetson Linux).

/opt/nvidia/vpi2/samples/assets/dashcam.mp4

As a result, I could not play this media file.
So, I tried to play by VLC. But, VLC crashed.

vlc --vvv /opt/nvidia/vpi2/samples/assets/dashcam.mp4

On the other hands, OpenCV VideoCapture API can decode this file.

So, it seems that this is a problem of HW decoder or NvMedia.
I don’t know if this behavior is a bug or a limitation.

My environment is as follows.

  • Jetson Orin NX 16GB
  • Jetson Linux 35.4.1

Hi,
Please try the command:

$ DISPLAY=:0 gst-launch-1.0 filesrc location=/opt/nvidia/vpi2/samples/assets/dashcam.mp4 ! qtdemux ! h264parse ! nvv4l2decoder ! 'video/x-raw(memory:NVMM)' ! nv3dsink

Thank you for your reply.
I tried.

$ DISPLAY=:0 gst-launch-1.0 filesrc location=/opt/nvidia/vpi2/samples/assets/dashcam.mp4 ! qtdemux ! h264parse ! nvv4l2decoder ! 'video/x-raw(memory:NVMM)' ! nv3dsink
Invalid MIT-MAGIC-COOKIE-1 keyInvalid MIT-MAGIC-COOKIE-1 keyInvalid MIT-MAGIC-COOKIE-1 keyInvalid MIT-MAGIC-COOKIE-1 keynvbufsurftransform: Could not get EGL display connection
Setting pipeline to PAUSED ...
Invalid MIT-MAGIC-COOKIE-1 keyERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstNv3dSink:nv3dsink0: GStreamer error: state change failed and some element failed to post a proper error message with the reason for the failure.
Additional debug info:
gstbasesink.c(5367): gst_base_sink_change_state (): /GstPipeline:pipeline0/GstNv3dSink:nv3dsink0:
Failed to start
Setting pipeline to NULL ...
Freeing pipeline ...

I found the following message.

Invalid MIT-MAGIC-COOKIE-1 keyInvalid MIT-MAGIC-COOKIE-1 keyInvalid MIT-MAGIC-COOKIE-1 keyInvalid MIT-MAGIC-COOKIE-1 keynvbufsurftransform: Could not get EGL display connection

So, I removed DISPLAY=:0. As a result, I could play media file.

$ gst-launch-1.0 filesrc location=/opt/nvidia/vpi2/samples/assets/dashcam.mp4 ! qtdemux ! h264parse ! nvv4l2decoder ! 'video/x-raw(memory:NVMM)' ! nv3dsink
Setting pipeline to PAUSED ...
Opening in BLOCKING MODE 
Pipeline is PREROLLING ...
NvMMLiteOpen : Block : BlockType = 261 
NvMMLiteBlockCreate : Block : BlockType = 261 
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock

What’s the reason that default video application and VLC could not play H.264 media file?
Please tell me.

Hi,

We don’t enable hardware acceleration in the paths, so it should look for software decoder. Not sure but it seems like no software decoder is found.

Thank you for your explanation.

We don’t enable hardware acceleration in the paths, so it should look for software decoder.
Not sure but it seems like no software decoder is found.

If this is a bug of Jetson Linux, I hope that this problem resolve in JetPack 6.0.

Hi,
We don’t expect this to be an issue since you can develop the use-case based on hardware decoder. Please try gstreamer or jetson_multimedia_api.

Thank you for your comment. I understood.

Also with gstreamer, you can just use gst-play-1.0:

gst-play-1.0 /opt/nvidia/vpi2/samples/assets/dashcam.mp4
1 Like

Thank you for your advice!
I could play H.264 media file by VLC.

And, I tried to use mpv(https://mpv.io/).

sudo apt install mpv
mpv /opt/nvidia/vpi2/samples/assets/dashcam.mp4

As a result, I could play H.264 media file, too.
And, the usage of this tool is very simple.

MPV would use GPU for decoding.
Gstreamer would use HW NVDEC (keeping your GPU fully available for something else).

MPV would use GPU for decoding.
Gstreamer would use HW NVDEC (keeping your GPU fully available for something else).

You’re right.
There is no problem in my usecase.

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