Issues decoding video using Gstreamer

Hi everyone !

I currently use Gstreamer for encoding and decoding purpose on a Jetson AGX Xavier board. I frist encoded a bunch of png images into a video in h264 format using the following instruction :

gst-launch-1.0 multifilesrc location="frame%01d.png" index=0 caps="image/png,framerate=20/1" ! pngdec ! videoconvert ! omxh264enc ! mp4mux ! filesink location=png_video.mp4

Now I want to decode this video into png images in order to compare with the input images. I tried this command:

gst-launch-1.0 filesrc location=png_video.mp4 ! qtdemux name=demux demux.video_0 ! queue ! h264parse ! omxh264dec ! pngenc ! multifilesink location="decoded_img/frame01d.png"

But it doesn’t work. The terminal gives me the following error:

ERROR: from element /GstPipeline:pipeline0/Gst0MXH264Dec-omxh264dec:omxh264dec-omxh264dec0: Internal data stream error

I try the same command with jpegenc and it works well. So i don’t understand what is the matter with pngenc.

Is anyone have an anwser ? Or maybe an other solution ? Thanks for helping

Hi,
Please try

gst-launch-1.0 filesrc location=png_video.mp4 ! qtdemux name=demux demux.video_0 ! queue ! h264parse ! omxh264dec ! nvvidconv ! video/x-raw ! pngenc ! multifilesink location="decoded_img/frame01d.png"

We have deprecated omx plugins and suggest use v4l2 plugins.

Thank you, this command works well !

Regarding v4l2 plugins, I made so try with this instruction for encoding (following the documentation example) :

gst-launch-1.0 multifilesrc location=“frame%01d.jpg” index=0 caps=“image/jpg,framerate=20/1” ! nvjpegdec ! nnv4l2h264enc ! h264parse ! qtmux ! filesink location=png_video.mp4

And I have some trubble because using v4l2 pluging takes way more time than using omw plugin. Is it normal ?

Hi,
You may try

gst-launch-1.0 multifilesrc location="frame%01d.jpg" index=0 caps="image/jpg,framerate=20/1" ! jpegparse ! nvv4l2decoder  mjpeg=1 ! nnv4l2h264enc ! h264parse ! qtmux ! filesink location=png_video.mp4

Thank you again.

As farm as I understand by checking the documentation, the nv4l2 plugin does support encoding for h264 and h265, but not decoding ? Moreover, since nvv4l2decoder doesn’t accept png inputs, it seems that this plugins is not adapted for png format. I’m right ?

Thanks a lot for helping.

Hi,
The nvv4l2decoder plugin is for decoding. The png format is not supported. Please check the capability in