H.264 Encoding with gstreamer not working

Hi,

I’m not having any success using streamer on the TX1 Development Board. Maybe someone knows where I’m going wrong.

I have installed gstreamer-1.0 Version 1.6.0

I’ve copied the example from “Tegra X1/Tegra Linux Driver Package Multimedia User Guide”:

gst-launch-1.0 -v -m filesrc location=./bbb_sunflower_2160p_30fps_normal.mp4 ! qtdemux name=demux demux.video_0 ! queue ! mpeg4videoparse ! omxmpeg4videodec ! nvvidconv ! omxh264enc ! qtmux name=mux ! filesink location=./bbb_sunflower_2160p_30fps_H265.mp4 demux.audio_0 ! queue ! aacparse ! mux.audio_0 -e

The output file bbb_sunflower_2160p_30fps_H265.mp4 is created, but has size 0 bytes.

This is the output at the terminal when called with verbose and messages options:

Setting pipeline to PAUSED …
Inside NvxLiteH264DecoderLowLatencyInitNvxLiteH264DecoderLowLatencyInit set DPB and MjstreamingInside NvxLiteH265DecoderLowLatencyInitNvxLiteH265DecoderLowLatencyInit set DPB and MjstreamingPipeline is PREROLLING …
Got message #27 from element “filesink0” (state-changed): GstMessageStateChanged, old-state=(GstState)GST_STATE_NULL, new-state=(GstState)GST_STATE_READY, pending-state=(GstState)GST_STATE_VOID_PENDING;
Got message #28 from element “mux” (state-changed): GstMessageStateChanged, old-state=(GstState)GST_STATE_NULL, new-state=(GstState)GST_STATE_READY, pending-state=(GstState)GST_STATE_VOID_PENDING;
Got message #29 from element “omxh264enc-omxh264enc0” (state-changed): GstMessageStateChanged, old-state=(GstState)GST_STATE_NULL, new-state=(GstState)GST_STATE_READY, pending-state=(GstState)GST_STATE_VOID_PENDING;
Got message #30 from element “aacparse0” (state-changed): GstMessageStateChanged, old-state=(GstState)GST_STATE_NULL, new-state=(GstState)GST_STATE_READY, pending-state=(GstState)GST_STATE_VOID_PENDING;
Got message #31 from element “nvvconv0” (state-changed): GstMessageStateChanged, old-state=(GstState)GST_STATE_NULL, new-state=(GstState)GST_STATE_READY, pending-state=(GstState)GST_STATE_VOID_PENDING;
Got message #32 from element “queue1” (state-changed): GstMessageStateChanged, old-state=(GstState)GST_STATE_NULL, new-state=(GstState)GST_STATE_READY, pending-state=(GstState)GST_STATE_VOID_PENDING;
Got message #33 from element “omxmpeg4videodec-omxmpeg4videodec0” (state-changed): GstMessageStateChanged, old-state=(GstState)GST_STATE_NULL, new-state=(GstState)GST_STATE_READY, pending-state=(GstState)GST_STATE_VOID_PENDING;
Got message #34 from element “mpeg4vparse0” (state-changed): GstMessageStateChanged, old-state=(GstState)GST_STATE_NULL, new-state=(GstState)GST_STATE_READY, pending-state=(GstState)GST_STATE_VOID_PENDING;
Got message #35 from element “queue0” (state-changed): GstMessageStateChanged, old-state=(GstState)GST_STATE_NULL, new-state=(GstState)GST_STATE_READY, pending-state=(GstState)GST_STATE_VOID_PENDING;
Got message #36 from element “demux” (state-changed): GstMessageStateChanged, old-state=(GstState)GST_STATE_NULL, new-state=(GstState)GST_STATE_READY, pending-state=(GstState)GST_STATE_VOID_PENDING;
Got message #37 from element “filesrc0” (state-changed): GstMessageStateChanged, old-state=(GstState)GST_STATE_NULL, new-state=(GstState)GST_STATE_READY, pending-state=(GstState)GST_STATE_VOID_PENDING;
Got message #38 from element “pipeline0” (state-changed): GstMessageStateChanged, old-state=(GstState)GST_STATE_NULL, new-state=(GstState)GST_STATE_READY, pending-state=(GstState)GST_STATE_PAUSED;
Got message #40 from element “mux” (state-changed): GstMessageStateChanged, old-state=(GstState)GST_STATE_READY, new-state=(GstState)GST_STATE_PAUSED, pending-state=(GstState)GST_STATE_VOID_PENDING;
Got message #41 from element “omxh264enc-omxh264enc0” (state-changed): GstMessageStateChanged, old-state=(GstState)GST_STATE_READY, new-state=(GstState)GST_STATE_PAUSED, pending-state=(GstState)GST_STATE_VOID_PENDING;
Got message #42 from element “aacparse0” (state-changed): GstMessageStateChanged, old-state=(GstState)GST_STATE_READY, new-state=(GstState)GST_STATE_PAUSED, pending-state=(GstState)GST_STATE_VOID_PENDING;
Got message #43 from element “nvvconv0” (state-changed): GstMessageStateChanged, old-state=(GstState)GST_STATE_READY, new-state=(GstState)GST_STATE_PAUSED, pending-state=(GstState)GST_STATE_VOID_PENDING;
Got message #44 from pad “queue1:src” (stream-status): GstMessageStreamStatus, type=(GstStreamStatusType)GST_STREAM_STATUS_TYPE_CREATE, owner=(GstElement)"(GstQueue)\ queue1", object=(GstTask)"(GstTask)\ queue1:src";
Got message #45 from element “queue1” (state-changed): GstMessageStateChanged, old-state=(GstState)GST_STATE_READY, new-state=(GstState)GST_STATE_PAUSED, pending-state=(GstState)GST_STATE_VOID_PENDING;
Got message #46 from element “omxmpeg4videodec-omxmpeg4videodec0” (state-changed): GstMessageStateChanged, old-state=(GstState)GST_STATE_READY, new-state=(GstState)GST_STATE_PAUSED, pending-state=(GstState)GST_STATE_VOID_PENDING;
Got message #47 from element “mpeg4vparse0” (state-changed): GstMessageStateChanged, old-state=(GstState)GST_STATE_READY, new-state=(GstState)GST_STATE_PAUSED, pending-state=(GstState)GST_STATE_VOID_PENDING;
Got message #48 from pad “queue0:src” (stream-status): GstMessageStreamStatus, type=(GstStreamStatusType)GST_STREAM_STATUS_TYPE_CREATE, owner=(GstElement)"(GstQueue)\ queue0", object=(GstTask)"(GstTask)\ queue0:src";
Got message #49 from element “queue0” (state-changed): GstMessageStateChanged, old-state=(GstState)GST_STATE_READY, new-state=(GstState)GST_STATE_PAUSED, pending-state=(GstState)GST_STATE_VOID_PENDING;
Got message #52 from pad “queue1:src” (stream-status): GstMessageStreamStatus, type=(GstStreamStatusType)GST_STREAM_STATUS_TYPE_ENTER, owner=(GstElement)"(GstQueue)\ queue1", object=(GstTask)"(GstTask)\ queue1:src";
Got message #53 from pad “demux:sink” (stream-status): GstMessageStreamStatus, type=(GstStreamStatusType)GST_STREAM_STATUS_TYPE_CREATE, owner=(GstElement)"(GstQTDemux)\ demux", object=(GstTask)"(GstTask)\ demux:sink";
Got message #54 from pad “queue0:src” (stream-status): GstMessageStreamStatus, type=(GstStreamStatusType)GST_STREAM_STATUS_TYPE_ENTER, owner=(GstElement)"(GstQueue)\ queue0", object=(GstTask)"(GstTask)\ queue0:src";
Got message #55 from element “demux” (state-changed): GstMessageStateChanged, old-state=(GstState)GST_STATE_READY, new-state=(GstState)GST_STATE_PAUSED, pending-state=(GstState)GST_STATE_VOID_PENDING;
Got message #56 from element “filesrc0” (state-changed): GstMessageStateChanged, old-state=(GstState)GST_STATE_READY, new-state=(GstState)GST_STATE_PAUSED, pending-state=(GstState)GST_STATE_VOID_PENDING;
Got message #57 from pad “demux:sink” (stream-status): GstMessageStreamStatus, type=(GstStreamStatusType)GST_STREAM_STATUS_TYPE_ENTER, owner=(GstElement)"(GstQTDemux)\ demux", object=(GstTask)"(GstTask)\ demux:sink";
Got message #83 from element “demux” (error): GstMessageError, gerror=(GError)NULL, debug=(string)“qtdemux.c(5306):\ gst_qtdemux_loop\ ():\ /GstPipeline:pipeline0/GstQTDemux:demux:\012streaming\ stopped,\ reason\ not-linked”;
ERROR: from element /GstPipeline:pipeline0/GstQTDemux:demux: GStreamer encountered a general stream error.
Additional debug info:
qtdemux.c(5306): gst_qtdemux_loop (): /GstPipeline:pipeline0/GstQTDemux:demux:
streaming stopped, reason not-linked
ERROR: pipeline doesn’t want to preroll.
Setting pipeline to NULL …
/GstPipeline:pipeline0/GstQTDemux:demux.GstPad:video_0: caps = “NULL”
/GstPipeline:pipeline0/GstQTDemux:demux.GstPad:audio_0: caps = “NULL”
/GstPipeline:pipeline0/GstQTDemux:demux.GstPad:audio_1: caps = “NULL”
Freeing pipeline …

Thanks in advance for any tips…

Hello, Francach
Try the following pipeline:

DISPLAY=:0 gst-launch-1.0 filesrc location=test.mp4 ! qtdemux name=demux ! h264parse ! omxh264dec ! nvvidconv ! ‘video/x-raw(memory:NVMM),width=1920, height=1080, format=(string)I420, framerate=(fraction)30/1’ ! omxh264enc ! qtmux ! filesink location=output.mp4 -e

br
Chenjian

Hallo Chenjian,

thank you for your suggestion.
That worked!