Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4906

Camera board • HW Encoder V4l2 add support for intra refresh

$
0
0
Hello,

I am trying to add support for intra-refresh encoding to the (new) v4l2 h264 hw encoder driver.

The reasoning behind: Intra refresh encoding is extremely usefully for live streaming, and it was supported in the 'old' mmal rpi
applcations.

However, I am running into a few issues.
I at first looked at the old rpivid application - mapping and setting intra refresh there was quite straight forward
(User params are mapped to mmal params).
However, when searching the (newer) linux mmal driver (wrapper) things seem to have changed a bit regarding enums and setting parameters,
so i am a bit lost.

The 2 issues I have right now are:
1) The intra refresh type enum value(s) are gone:
MMAL_VIDEO_INTRA_REFRESH_CYCLIC, MMAL_VIDEO_INTRA_REFRESH_ADAPTIVE, ...
( I cannot find them at all in the linux kernel source code, where mmal seems to live nowadays)

2) Intra refresh itself was always a bit voodoo on rpi (with what types of intra refresh each are being not exactly defined.

So far, the one 'type' of intra refresh I know (and would like) is some type of cyclic intra refresh where a frame is fully intra refreshed
in the GOP size. This is also conveniently a quite simple to understand type of intra refresh:

If gop for example is 6, without intra refresh, there is one intra frame every 6 frames.
With intra refresh enabled (see x264 sw encoder for a working encoder example) Each frame 1/6 of the frame is intra refreshed, and there is
never a full I frame.

So my 2 questions are:
1) Is the above described intra refresh possible on rpi hw encoder ?
2) Is it possible to set the required mmal params for intra refresh in the v4l2 driver ?

V4l2 itself has some definitiions regarding intra already - most notably,
V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_PERIOD_TYPE
and
V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_PERIOD
V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB


It would be a pitty if intra refresh is completely removed from the rpi hw encoder by the switch from raspivid / mmal to v4l2 even though the hw supports it and it was supported (Downgrade)

Statistics: Posted by Consti10^100 — Wed Jan 24, 2024 8:18 am



Viewing all articles
Browse latest Browse all 4906

Trending Articles