[FFmpeg-devel] [PATCH RFC v2 2/3] libavcodec: Add thumbnail output to vaapi_h264 decoder
Zhou, Zachary
zachary.zhou at intel.com
Wed Apr 10 04:22:35 EEST 2019
> -----Original Message-----
> From: ffmpeg-devel [mailto:ffmpeg-devel-bounces at ffmpeg.org] On Behalf Of
> Hendrik Leppkes
> Sent: Monday, April 8, 2019 5:27 PM
> To: FFmpeg development discussions and patches <ffmpeg-devel at ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH RFC v2 2/3] libavcodec: Add thumbnail
> output to vaapi_h264 decoder
>
> On Mon, Apr 8, 2019 at 10:54 AM Zachary Zhou <zachary.zhou at intel.com>
> wrote:
> >
> > This is sample code for reference
> >
> > HW support for decode+scaling in a single HW command (VDBOX+SFC).
> > The primary target usage is video analytics, but can be used playback,
> > transcoding, etc.
> >
> > For VAAPI -
> > https://github.com/intel/libva
> > basically, it allows multiple outputs (in different resolutions) using the
> decode context in a single call (you can search for “additional_outputs” in
> va.h).
> >
> > VAAPI sample code -
> > https://github.com/intel/libva-utils/commit/957a269f02b00760b7e807643c
> > 821ee26abc529b
> > ---
> > libavcodec/avcodec.h | 8 +++
> > libavcodec/decode.c | 16 +++++
> > libavcodec/options_table.h | 4 ++
> > libavcodec/vaapi_decode.c | 122
> > ++++++++++++++++++++++++++++++++++---
> > libavcodec/vaapi_decode.h | 30 +++++++++
> > libavcodec/vaapi_h264.c | 13 ++++
> > 6 files changed, 185 insertions(+), 8 deletions(-)
> >
> > diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index
> > 0ce22ec4fa..36db21c0a5 100644
> > --- a/libavcodec/avcodec.h
> > +++ b/libavcodec/avcodec.h
> > @@ -3357,6 +3357,14 @@ typedef struct AVCodecContext {
> > * - encoding: unused
> > */
> > int discard_damaged_percentage;
> > +
> > + /*
> > + * Thumbnail options
> > + */
> > + int thumbnail_flags;
> > + int thumbnail_format;
> > + int thumbnail_width;
> > + int thumbnail_height;
> > } AVCodecContext;
> >
>
> Global fields for such a purpose seem not appropriate. We try to get away
> from fields that only serve a single purpose with a single decoder. Nevermind
> that they aren't even documented.
>
> In general I must say I'm not sure I like this entire patchset. We have
> component seperation for a reason, so trying to add magic features like that is
> generally a bad idea.
>
> - Hendrik
Thanks Hendrik for the comments.
currently I didn't find any good places to set input parameters for decoder, in this feature I think the end user may want to set the scaling size and out format.
And I don't know if ffmpeg will add better decoder input parameters control in future.
This feature will also save the scaling filter code writing for the end user.
-Zach
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email ffmpeg-devel-request at ffmpeg.org
> with subject "unsubscribe".
More information about the ffmpeg-devel
mailing list