GStreamer in Jetson Nano

Hello, I am using GStreamer on the Jetson Nano and my goal is to compress a yuv file into an mp4 file using omxh264enc. I have the following code, which does not work:

gst-launch-1.0 filesrc location=secuencias/RaceHorses_300F_832x480_30Hz_P420.yuv ! rawvideoparse format=i420 width=832 height=480 ! videoconvert ! omxh264enc ! queue ! mp4mux ! filesink location=omx_salida/pruebasalida.mp4

Error: del elemento /GstPipeline:pipeline0/GstOMXH264Enc-omxh264enc:omxh264enc-omxh264enc0: Internal data stream error. InformaciĂłn adicional de depuraciĂłn: gstomxvideoenc.c(1602): gst_omx_video_enc_loop (): /GstPipeline:pipeline0/GstOMXH264Enc-omxh264enc:omxh264enc-omxh264enc0:

What’s wrong with this command? How can compression be done correctly?

Please try

gst-launch-1.0 filesrc location=secuencias/RaceHorses_300F_832x480_30Hz_P420.yuv ! videoparse format=i420 width=832 height=480 ! nvvidconv ! nvv4l2h264enc ! h264parse ! qtmux ! filesink location=omx_salida/pruebasalida.mp4
1 Like

It’s works. Thank you!


is it possible to calculate the psnr?

Hello again,

I have another question. I want only intra coding. What should the value of iframeinterval be: iframeinterval = 0 or iframeinterval = 1?

Please run ffmpeg to check PSNR:

For intra encoding, please try

$ gst-launch-1.0 videotestsrc num-buffers=300 ! nvvidconv ! nvv4l2h264enc iframeinterval=4294967295 ! video/x-h264 ! filesink location=a.h264
1 Like

Hello, thank you very much for your contributions.

PSNR calculation works, but I have some doubts with only intra coding, since I don’t know if all frames are actually intra. Is there a way to know if all the frames are intra?

Thanks in advance

I have verified with the Vega HEVC Analyzer software that only the first frame is Intra. Therefore I assume that the command “iframeinterval = 4294967295” does not get all frames to be Intra. I will try other values ​​and publish the results here.


Probably I misunderstood your request. I thought you need the structure like IDR P P … I P P … I P P…. Only the first frame is IDR frame and the rest are I frames. But looks like you need to encode all frames to IDR frames?