So I got the libgstomx library built, it just needed some headers and such from libEGL to build completely, so I connected it with them and it was good to go.
So now the library is built and tested, works well. The problem still persists, though, even with the patch in place. The behavior seems the same with the original plugin vs the built one with the patch. Below I have some samples, but it seems to suddenly fall off to 13fps, after being at 50+ for maybe 5 seconds. It’s very odd behavior. This seems like thermal throttling or something of that nature. Any thoughts?
In the logs below, note the ‘current’ field of fpsdisplaysink0.
Original plugin, nvpmodel 0. Starts strong @ 50-70fps for 6 seconds, then suddenly dies off to 12-13 fps.
$ gst-launch-1.0 filesrc location=4k.yuv blocksize=22118400 ! 'video/x-raw, format=(string)I420,width=(int)3840,height=(int)3840,framerate=(fraction)30/1' ! omxh264enc ! qtmux ! fpsdisplaysink video-sink="filesink location=vid.MP4" text-overlay=false -v
Setting pipeline to PAUSED ...
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstFileSink:filesink0: sync = true
Pipeline is PREROLLING ...
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = "video/x-raw\,\ width\=\(int\)3840\,\ height\=\(int\)3840\,\ format\=\(string\)I420\,\ framerate\=\(fraction\)30/1"
Framerate set to : 30 at NvxVideoEncoderSetParameterNvMMLiteOpen : Block : BlockType = 4
===== MSENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
/GstPipeline:pipeline0/GstOMXH264Enc-omxh264enc:omxh264enc-omxh264enc0.GstPad:sink: caps = "video/x-raw\,\ width\=\(int\)3840\,\ height\=\(int\)3840\,\ format\=\(string\)I420\,\ framerate\=\(fraction\)30/1"
===== MSENC blits (mode: 1) into tiled surfaces =====
/GstPipeline:pipeline0/GstOMXH264Enc-omxh264enc:omxh264enc-omxh264enc0.GstPad:src: caps = "video/x-h264\,\ alignment\=\(string\)au\,\ stream-format\=\(string\)avc\,\ width\=\(int\)3840\,\ height\=\(int\)3840\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ framerate\=\(fraction\)30/1"
/GstPipeline:pipeline0/GstOMXH264Enc-omxh264enc:omxh264enc-omxh264enc0.GstPad:src: caps = "video/x-h264\,\ alignment\=\(string\)au\,\ stream-format\=\(string\)avc\,\ width\=\(int\)3840\,\ height\=\(int\)3840\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ framerate\=\(fraction\)30/1\,\ codec_data\=\(buffer\)014240150301000a6742403495a00f001e1901000468ce3c80"
/GstPipeline:pipeline0/GstQTMux:qtmux0.GstPad:video_0: caps = "video/x-h264\,\ alignment\=\(string\)au\,\ stream-format\=\(string\)avc\,\ width\=\(int\)3840\,\ height\=\(int\)3840\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ framerate\=\(fraction\)30/1\,\ codec_data\=\(buffer\)014240150301000a6742403495a00f001e1901000468ce3c80"
/GstPipeline:pipeline0/GstQTMux:qtmux0.GstPad:src: caps = "video/quicktime\,\ variant\=\(string\)apple"
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0.GstGhostPad:sink.GstProxyPad:proxypad0: caps = "video/quicktime\,\ variant\=\(string\)apple"
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstFileSink:filesink0.GstPad:sink: caps = "video/quicktime\,\ variant\=\(string\)apple"
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0.GstGhostPad:sink: caps = "video/quicktime\,\ variant\=\(string\)apple"
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstFileSink:filesink0: sync = true
New clock: GstSystemClock
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 26, dropped: 0, current: 50.08, average: 50.08
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 60, dropped: 0, current: 67.94, average: 58.85
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 96, dropped: 0, current: 71.94, average: 63.16
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 132, dropped: 0, current: 70.20, average: 64.93
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 169, dropped: 0, current: 69.57, average: 65.90
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 202, dropped: 0, current: 63.26, average: 65.45
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 209, dropped: 0, current: 12.20, average: 57.11
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 215, dropped: 0, current: 11.75, average: 51.55
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 221, dropped: 0, current: 11.66, average: 47.17
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 227, dropped: 0, current: 11.76, average: 43.69
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 234, dropped: 0, current: 12.53, average: 40.66
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 240, dropped: 0, current: 11.68, average: 38.29
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 247, dropped: 0, current: 12.00, average: 36.05
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 253, dropped: 0, current: 11.47, average: 34.31
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 259, dropped: 0, current: 11.70, average: 32.84
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 265, dropped: 0, current: 11.60, average: 31.53
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 271, dropped: 0, current: 11.41, average: 30.35
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 278, dropped: 0, current: 12.12, average: 29.24
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 285, dropped: 0, current: 12.46, average: 28.30
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 291, dropped: 0, current: 11.91, average: 27.52
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 298, dropped: 0, current: 12.18, average: 26.73
Built plugin, sustained the high speed for the same 6 seconds, then died off.
$ gst-launch-1.0 filesrc location=4k.yuv blocksize=22118400 ! 'video/x-raw, format=(string)I420,width=(int)3840,height=(int)3840,framerate=(fraction)30/1' ! omxh264enc ! qtmux ! fpsdisplaysink video-sink="filesink location=vid.MP4" text-overlay=false -v
Setting pipeline to PAUSED ...
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstFileSink:filesink0: sync = true
Pipeline is PREROLLING ...
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = "video/x-raw\,\ width\=\(int\)3840\,\ height\=\(int\)3840\,\ format\=\(string\)I420\,\ framerate\=\(fraction\)30/1"
Framerate set to : 30 at NvxVideoEncoderSetParameterNvMMLiteOpen : Block : BlockType = 4
===== MSENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
/GstPipeline:pipeline0/GstOMXH264Enc-omxh264enc:omxh264enc-omxh264enc0.GstPad:sink: caps = "video/x-raw\,\ width\=\(int\)3840\,\ height\=\(int\)3840\,\ format\=\(string\)I420\,\ framerate\=\(fraction\)30/1"
===== MSENC blits (mode: 1) into tiled surfaces =====
/GstPipeline:pipeline0/GstOMXH264Enc-omxh264enc:omxh264enc-omxh264enc0.GstPad:src: caps = "video/x-h264\,\ alignment\=\(string\)au\,\ stream-format\=\(string\)avc\,\ width\=\(int\)3840\,\ height\=\(int\)3840\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ framerate\=\(fraction\)30/1"
/GstPipeline:pipeline0/GstOMXH264Enc-omxh264enc:omxh264enc-omxh264enc0.GstPad:src: caps = "video/x-h264\,\ alignment\=\(string\)au\,\ stream-format\=\(string\)avc\,\ width\=\(int\)3840\,\ height\=\(int\)3840\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ framerate\=\(fraction\)30/1\,\ codec_data\=\(buffer\)014240150301000a6742403495a00f001e1901000468ce3c80"
/GstPipeline:pipeline0/GstQTMux:qtmux0.GstPad:video_0: caps = "video/x-h264\,\ alignment\=\(string\)au\,\ stream-format\=\(string\)avc\,\ width\=\(int\)3840\,\ height\=\(int\)3840\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ framerate\=\(fraction\)30/1\,\ codec_data\=\(buffer\)014240150301000a6742403495a00f001e1901000468ce3c80"
/GstPipeline:pipeline0/GstQTMux:qtmux0.GstPad:src: caps = "video/quicktime\,\ variant\=\(string\)apple"
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0.GstGhostPad:sink.GstProxyPad:proxypad0: caps = "video/quicktime\,\ variant\=\(string\)apple"
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstFileSink:filesink0.GstPad:sink: caps = "video/quicktime\,\ variant\=\(string\)apple"
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0.GstGhostPad:sink: caps = "video/quicktime\,\ variant\=\(string\)apple"
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstFileSink:filesink0: sync = true
New clock: GstSystemClock
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 23, dropped: 0, current: 45.55, average: 45.55
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 62, dropped: 0, current: 75.01, average: 60.50
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 100, dropped: 0, current: 75.57, average: 65.46
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 138, dropped: 0, current: 75.12, average: 67.86
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 176, dropped: 0, current: 74.52, average: 69.19
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 204, dropped: 0, current: 49.90, average: 65.71
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 211, dropped: 0, current: 12.55, average: 57.61
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 218, dropped: 0, current: 12.22, average: 51.48
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 224, dropped: 0, current: 11.94, average: 47.28
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 231, dropped: 0, current: 12.01, average: 43.42
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 237, dropped: 0, current: 11.60, average: 40.60
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 244, dropped: 0, current: 12.05, average: 38.01
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 251, dropped: 0, current: 12.30, average: 35.92
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 258, dropped: 0, current: 12.47, average: 34.18
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 265, dropped: 0, current: 12.51, average: 32.68
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 272, dropped: 0, current: 11.96, average: 31.29
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 279, dropped: 0, current: 12.08, average: 30.09
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 286, dropped: 0, current: 12.04, average: 29.02
This is a re-try with the built plugin, it really held out for a long time before dropping off, but this obviously isn’t consistent enough for long recording times and the like:
$ gst-launch-1.0 filesrc location=4k.yuv blocksize=22118400 ! 'video/x-raw, format=(string)I420,width=(int)3840,height=(int)3840,framerate=(fraction)30/1' ! omxh264enc ! qtmux ! fpsdisplaysink video-sink="filesink location=vid.MP4" text-overlay=false -v
Setting pipeline to PAUSED ...
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstFileSink:filesink0: sync = true
Pipeline is PREROLLING ...
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = "video/x-raw\,\ width\=\(int\)3840\,\ height\=\(int\)3840\,\ format\=\(string\)I420\,\ framerate\=\(fraction\)30/1"
Framerate set to : 30 at NvxVideoEncoderSetParameterNvMMLiteOpen : Block : BlockType = 4
===== MSENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
/GstPipeline:pipeline0/GstOMXH264Enc-omxh264enc:omxh264enc-omxh264enc0.GstPad:sink: caps = "video/x-raw\,\ width\=\(int\)3840\,\ height\=\(int\)3840\,\ format\=\(string\)I420\,\ framerate\=\(fraction\)30/1"
===== MSENC blits (mode: 1) into tiled surfaces =====
/GstPipeline:pipeline0/GstOMXH264Enc-omxh264enc:omxh264enc-omxh264enc0.GstPad:src: caps = "video/x-h264\,\ alignment\=\(string\)au\,\ stream-format\=\(string\)avc\,\ width\=\(int\)3840\,\ height\=\(int\)3840\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ framerate\=\(fraction\)30/1"
/GstPipeline:pipeline0/GstOMXH264Enc-omxh264enc:omxh264enc-omxh264enc0.GstPad:src: caps = "video/x-h264\,\ alignment\=\(string\)au\,\ stream-format\=\(string\)avc\,\ width\=\(int\)3840\,\ height\=\(int\)3840\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ framerate\=\(fraction\)30/1\,\ codec_data\=\(buffer\)014240150301000a6742403495a00f001e1901000468ce3c80"
/GstPipeline:pipeline0/GstQTMux:qtmux0.GstPad:video_0: caps = "video/x-h264\,\ alignment\=\(string\)au\,\ stream-format\=\(string\)avc\,\ width\=\(int\)3840\,\ height\=\(int\)3840\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ framerate\=\(fraction\)30/1\,\ codec_data\=\(buffer\)014240150301000a6742403495a00f001e1901000468ce3c80"
/GstPipeline:pipeline0/GstQTMux:qtmux0.GstPad:src: caps = "video/quicktime\,\ variant\=\(string\)apple"
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0.GstGhostPad:sink.GstProxyPad:proxypad0: caps = "video/quicktime\,\ variant\=\(string\)apple"
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstFileSink:filesink0.GstPad:sink: caps = "video/quicktime\,\ variant\=\(string\)apple"
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0.GstGhostPad:sink: caps = "video/quicktime\,\ variant\=\(string\)apple"
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstFileSink:filesink0: sync = true
New clock: GstSystemClock
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 26, dropped: 0, current: 51.34, average: 51.34
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 63, dropped: 0, current: 73.68, average: 62.47
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 100, dropped: 0, current: 71.40, average: 65.50
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 138, dropped: 0, current: 73.62, average: 67.55
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 176, dropped: 0, current: 74.29, average: 68.90
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 211, dropped: 0, current: 69.42, average: 68.99
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 249, dropped: 0, current: 73.35, average: 69.62
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 287, dropped: 0, current: 70.25, average: 69.70
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 294, dropped: 0, current: 12.13, average: 62.62
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 301, dropped: 0, current: 11.95, average: 57.00
Maybe there’s some hard limits in the encoder for thermals or whatever? I’ll try getting the simple encoder example built with the patch integrated and see what I get there.