Re-encode h264 with lower framerate

Hi,

I need to re-encode a h264 stream with a lower framerate (by dropping frames) without using too much cpu. I’m trying to set the omxh264enc temporal-tradeoff parameter, but it seems that it not works with the NVMM memory.

For example, with this pipeline, the frame dropping is ok (I obtain a 5 fps stream):

gst-launch-1.0 videotestsrc horizontal-speed=100 is-live=true ! capsfilter caps=video/x-raw,width=1920,height=1080,framerate=15/1 ! nvvidconv ! ‘video/x-raw’ ! omxh264enc temporal-tradeoff=4 ! h264parse ! omxh264dec ! nveglglessink sync=0 async=0

but when using the NVMM memory, it not works (it is ok only with temporal-tradeoff=0):

gst-launch-1.0 videotestsrc horizontal-speed=100 is-live=true ! capsfilter caps=video/x-raw,width=1920,height=1080,framerate=15/1 ! nvvidconv ! ‘video/x-raw(memory:NVMM)’ ! omxh264enc temporal-tradeoff=4 ! h264parse ! omxh264dec ! nveglglessink sync=0 async=0

Can you help me?

Thanks, best regards.

Ivan

Hi Ivan,
Please try
$ gst-launch-1.0 videotestsrc is-live=true num-buffers=100 ! capsfilter caps=video/x-raw,width=1920,height=1080,framerate=15/1 ! nvvidconv output-buffers=15 ! ‘video/x-raw(memory:NVMM)’ ! omxh264enc temporal-tradeoff=4 ! h264parse ! omxh264dec ! fpsdisplaysink video-sink=nvhdmioverlaysink text-overlay=false sync=false -v

Hi DaneLLL,
thank you, with nvvidconv output-buffers=15 the re-encoding is ok also using the NVMM memory.

Is the value (15) related to the original framerate or can I set it always to 15, regardless of the original framerate value?

Thank you, best regards.

Ivan

Hi Ivan,
15 is not related to the framerate. For running temporal-tradeoff=4, you shall need 10 buffers at least.

Hi DaneLL,

ok, thank you!

Ivan