Re: [PATCH] v4l: add V4L2_CID_MPEG_VIDEO_FORCE_FRAME_TYPE.

Nicolas Dufresne
2016-01-15T17:21:27Z

[-- Attachment #1: Type: text/plain, Size: 1893 bytes --]

Le vendredi 15 janvier 2016 à 18:01 +0100, Kamil Debski a écrit :
> I think we had a discussion about this long, long time ago. Should it
> be
> deterministic which frame Is encoded as a key frame? Should it be the
> next queued frame, or the next processed frame? How to achieve this?
> I vaguely remember that we discussed per buffer controls on the
> mailing
> list, but I am not sure where the discussion went from there.

In RTP use cases (and most streaming cases), all we care is that we
have a key-frame produced somewhere nearby after the request. In those
cases we use P frame only stream to reduce the bandwidth and only
request a key frame for recovery. This I believe that most common case.

Many decoders though also offer what they called an "automatic" key
frame mode. In the case of x264, there is also hints you can give to
the encoder about what type of video (film, anime, etc.) so it can
optimize all this. I believe this is very advance and there is no
particular need for it.

>
> >
> > - A way to trigger a key frame to be produce
> > - A way to produce a I-Frame only stream
>
> This control can be used to do this:
> - V4L2_CID_MPEG_VIDEO_GOP_SIZE (It is not well documented as I can
> see ;) )
>         + If set to 0 the encoder produces a stream with P only
> frames
>         + if set to 1 the encoder produces a stream with I only
> frames
>         + other values indicate the GOP size (I-frame interval)
>
> > - A way to set the key-frame distance (in frames) even though this
> could
> > possibly be emulated using the trigger.
>
> As described above V4L2_CID_MPEG_VIDEO_GOP_SIZE can be used to
> achieve this.

Great, my memory failed on me, should have checked. This is exactly
what I was thinking. So Wu-Cheng Li patch is really what we need in the
immediate.

regards,
Nicolas

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 181 bytes --]