Skip to content

x264enc: add Region-of-Interest encoding

Altay Akkus requested to merge AltayAkkus/gstreamer:x264-add-roi into main

Hey, first commit to GStreamer 🤘

I added support for Region-of-Interest encoding to x264enc.

I have taken inspiration from ffmpeg implementation of their addroi parameter into x264.

The property accepts a comma delimited string describing the region of interest, e.g.

topX,topY,bottomX,bottomY,qoffset 0,0,360,240,-1/10

qoffset is directly passed into x264 and a bit fiddly, check out https://ffmpeg.org/ffmpeg-filters.html#addroi.

Look at this example (CBR 500k)

roi_test

Some development notes: The Gst property is filling roi_string, which is then parsed to rois to be used in frame encoder loop, due to performance reasons.

The only reason why the property setter is not a one-way street to encoder->rois is because of the property getter, which one could arguably just leave out.

Merge request reports

Loading