Comparing software vs. hardware video decode

I notice that the ‘omx*’ gstreamer plugins enable the video acceleration of the TX2 in processing media streams. I want to compare the processor utilization of a solely software decode against a hardware assisted decode.

The current hardware decode is: gst-launch-1.0 filesrc location=/home/nvidia/HD_H264_06011_TS_ASYN_V1_001.mpeg ! tsdemux name=demux demux. ! h264parse ! omxh264dec ! nvoverlaysink -e

I try a software decode version of the command:

nvidia@tegra-ubuntu:~/scripts/works/files$ gst-launch-1.0 filesrc location=/home/nvidia/HD_H264_06011_TS_ASYN_V1_001.mpeg ! tsdemux name=demux demux. ! h264parse ! avdec_h264 ! nvoverlaysink -e
Setting pipeline to PAUSED …
Inside NvxLiteH264DecoderLowLatencyInitNvxLiteH264DecoderLowLatencyInit set DPB and MjstreamingInside NvxLiteH265DecoderLowLatencyInitNvxLiteH265DecoderLowLatencyInit set DPB and MjstreamingPipeline is PREROLLING …
Redistribute latency…
Redistribute latency…
Pipeline is PREROLLED …
Setting pipeline to PLAYING …
New clock: GstSystemClock
*** Error in `gst-launch-1.0’: corrupted double-linked list: 0x0000007f70553970 ***
^C^C^C^CAborted (core dumped)

Right after the error you might find details of the failure in dmesg. Try running “sudo dmesg --follow”, then watch the output as the core dump takes place. If something shows you might want to quote it here (the “</>” code block icon in the upper right will let you paste longer code or logs and preserve formatting in the forum).

nvidia@tegra-ubuntu:~/scripts/works/files$ gdb --args gst-launch-1.0 filesrc location=/home/nvidia/HD_H264_06011_TS_ASYN_V1_001.mpeg ! tsdemux name=demux demux. ! h264parse ! avdec_h264 ! nvoverlaysink -e
GNU gdb (Ubuntu 7.11-0ubuntu1) 7.11
Copyright © 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type “show copying”
and “show warranty” for details.
This GDB was configured as “aarch64-linux-gnu”.
Type “show configuration” for configuration details.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/.
Find the GDB manual and other documentation resources online at:
http://www.gnu.org/software/gdb/documentation/.
For help, type “help”.
Type “apropos word” to search for commands related to “word”…
Reading symbols from gst-launch-1.0…(no debugging symbols found)…done.
(gdb) run
Starting program: /usr/bin/gst-launch-1.0 filesrc location=/home/nvidia/HD_H264_06011_TS_ASYN_V1_001.mpeg ! tsdemux name=demux demux. ! h264parse ! avdec_h264 ! nvoverlaysink -e
[Thread debugging using libthread_db enabled]
Using host libthread_db library “/lib/aarch64-linux-gnu/libthread_db.so.1”.
Setting pipeline to PAUSED …
Inside NvxLiteH264DecoderLowLatencyInitNvxLiteH264DecoderLowLatencyInit set DPB and MjstreamingInside NvxLiteH265DecoderLowLatencyInitNvxLiteH265DecoderLowLatencyInit set DPB and Mjstreaming[New Thread 0x7faef21200 (LWP 16092)]
[New Thread 0x7fae721200 (LWP 16093)]
Pipeline is PREROLLING …
[New Thread 0x7fadf21200 (LWP 16094)]
[New Thread 0x7fad721200 (LWP 16095)]
[New Thread 0x7facf21200 (LWP 16096)]
[New Thread 0x7fa7fff200 (LWP 16097)]
[New Thread 0x7fa77ff200 (LWP 16098)]
[New Thread 0x7fa6fff200 (LWP 16099)]
[New Thread 0x7fa67ff200 (LWP 16100)]
Redistribute latency…
Redistribute latency…
Pipeline is PREROLLED …
Setting pipeline to PLAYING …
New clock: GstSystemClock
*** Error in `/usr/bin/gst-launch-1.0’: corrupted double-linked list: 0x0000007fa8553970 ***

Thread 3 “demux:sink” received signal SIGABRT, Aborted.
[Switching to Thread 0x7fae721200 (LWP 16093)]
0x0000007fb7bf0528 in __GI_raise (sig=sig@entry=6) at …/sysdeps/unix/sysv/linux/raise.c:54
54 …/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0 0x0000007fb7bf0528 in __GI_raise (sig=sig@entry=6) at …/sysdeps/unix/sysv/linux/raise.c:54
#1 0x0000007fb7bf19e0 in __GI_abort () at abort.c:89
#2 0x0000007fb7c278c4 in __libc_message (do_abort=do_abort@entry=2, fmt=fmt@entry=0x7fb7cd83d0 “*** Error in `%s’: %s: 0x%s ***\n”)
at …/sysdeps/posix/libc_fatal.c:175
#3 0x0000007fb7c2d2ec in malloc_printerr (action=, str=0x7fb7cd8418 “corrupted double-linked list”, ptr=,
ar_ptr=) at malloc.c:5004
#4 0x0000007fb7c2f950 in _int_malloc (av=av@entry=0x7fa8000020, bytes=bytes@entry=4128) at malloc.c:3725
#5 0x0000007fb7c2fdcc in _int_memalign (av=av@entry=0x7fa8000020, alignment=alignment@entry=2048, bytes=bytes@entry=2032) at malloc.c:4419
#6 0x0000007fb7c3160c in _mid_memalign (alignment=2048, bytes=2032, address=) at malloc.c:3118
#7 0x0000007fb7c336e8 in __posix_memalign (memptr=0x7fae720150, alignment=, size=) at malloc.c:5026
#8 0x0000007fb7d9a528 in ?? () from /lib/aarch64-linux-gnu/libglib-2.0.so.0
#9 0x0000000000000090 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb)

[ 1422.006804] PD DISP0 index2 DOWN
[ 1422.022206] tegradc 15210000.nvdisplay: unblank
[ 1422.022223] PD DISP0 index2 UP
[ 1422.022340] PD DISP1 index3 UP
[ 1422.022342] PD DISP2 index4 UP
[ 1422.028840] rate get on hub 408000000
[ 1422.029377] Parent Clock set for DC plld2
[ 1422.029808] dc clk 297000000
[ 1422.032784] tegradc 15210000.nvdisplay: Link compression not supported by the panel
[ 1422.032790] rate get on compclk 297000000
[ 1422.064881] tegradc 15210000.nvdisplay: Window 3 assigned to head 1
[ 1422.098204] tegradc 15210000.nvdisplay: Window 4 assigned to head 1
[ 1422.131542] tegradc 15210000.nvdisplay: Window 5 assigned to head 1
[ 1422.220365] tegradc 15210000.nvdisplay: unblank
[ 2324.068531] falcon 15340000.vic: nvhost_ioctl_channel_submit: failed with err -22

[ 2324.077665] falcon 15340000.vic: nvhost_ioctl_channel_submit: failed with err -22

[ 2338.168413] falcon 15340000.vic: nvhost_ioctl_channel_submit: failed with err -22

[ 2338.177679] falcon 15340000.vic: nvhost_ioctl_channel_submit: failed with err -22

nvidia@tegra-ubuntu:~/scripts/works/files$ gst-launch-1.0 filesrc location=/home/nvidia/HD_H264_06011_TS_ASYN_V1_001.mpeg ! tsdemux name=demux demux. ! h264parse ! avdec_h264 ! nvoverlaysink -e
Setting pipeline to PAUSED …
Inside NvxLiteH264DecoderLowLatencyInitNvxLiteH264DecoderLowLatencyInit set DPB and MjstreamingInside NvxLiteH265DecoderLowLatencyInitNvxLiteH265DecoderLowLatencyInit set DPB and MjstreamingPipeline is PREROLLING …
Redistribute latency…
Redistribute latency…
Pipeline is PREROLLED …
Setting pipeline to PLAYING …
New clock: GstSystemClock
*** Error in `gst-launch-1.0’: corrupted double-linked list: 0x0000007f8c553970 ***
Aborted (core dumped)
nvidia@tegra-ubuntu:~/scripts/works/files$ jobs
[1]- Running sudo dmesg --follow &

Please try gst-launch-1.0 filesrc location= videoplayback.mp4 ! qtdemux ! h264parse ! avdec_h264 ! nvvidconv ! nvoverlaysink

Thanks. That works for the decoder. I want to change the encoder to use software also. Here is my software encoder attempt:

  • CLIENT_IP=239.255.0.1
  • gst-launch-1.0 filesrc location=/home/nvidia/HD_MP2_06011_TS_ASYN_V1_001.mpeg ! tsdemux name=demux demux. ! mpegvideoparse ! omxmpeg2videodec ! nvvidconv ! video/x-raw(memory:NVMM), format=(string)I420 ! x264enc ! video/x-h264, stream-format=(string)byte-stream ! h264parse ! rtph264pay mtu=1400 ! udpsink host=239.255.0.1 port=5000 sync=false async=false
    WARNING: erroneous pipeline: could not link nvvconv0 to x264enc0

Hi kunice, please try
gst-launch-1.0 filesrc location=/home/nvidia/HD_MP2_06011_TS_ASYN_V1_001.mpeg ! tsdemux name=demux demux. ! mpegvideoparse ! omxmpeg2videodec ! nvvidconv ! video/x-raw, format=(string)I420 ! x264enc ! video/x-h264, stream-format=(string)byte-stream ! h264parse ! rtph264pay mtu=1400 ! udpsink host=239.255.0.1 port=5000 sync=false async=false