x264enc: add Region-of-Interest encoding
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)
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.