Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH 1/4] lavfi/qsvvpp: change the output frame's width and height
@ 2022-11-24  9:19 Xiang, Haihao
  2022-11-24  9:19 ` [FFmpeg-devel] [PATCH 2/4] lavfi/qsvvpp: avoid overriding the returned value Xiang, Haihao
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Xiang, Haihao @ 2022-11-24  9:19 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Chen,Wenbin

From: "Chen,Wenbin" <wenbin.chen@intel.com>

Make sure the size of the output frame always matches the agreed upon
image size.

Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
---
 libavfilter/qsvvpp.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/libavfilter/qsvvpp.c b/libavfilter/qsvvpp.c
index 8428ee89ab..bf719b2a29 100644
--- a/libavfilter/qsvvpp.c
+++ b/libavfilter/qsvvpp.c
@@ -487,15 +487,14 @@ static QSVFrame *query_frame(QSVVPPContext *s, AVFilterLink *outlink)
         if (!out_frame->frame)
             return NULL;
 
-        out_frame->frame->width  = outlink->w;
-        out_frame->frame->height = outlink->h;
-
         ret = map_frame_to_surface(out_frame->frame,
                                    &out_frame->surface);
         if (ret < 0)
             return NULL;
     }
 
+    out_frame->frame->width  = outlink->w;
+    out_frame->frame->height = outlink->h;
     out_frame->surface.Info = s->vpp_param.vpp.Out;
 
     return out_frame;
-- 
2.25.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [FFmpeg-devel] [PATCH 2/4] lavfi/qsvvpp: avoid overriding the returned value
  2022-11-24  9:19 [FFmpeg-devel] [PATCH 1/4] lavfi/qsvvpp: change the output frame's width and height Xiang, Haihao
@ 2022-11-24  9:19 ` Xiang, Haihao
  2022-11-24  9:19 ` [FFmpeg-devel] [PATCH 3/4] lavfi/qsvvpp: provide a default framerate if needed Xiang, Haihao
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: Xiang, Haihao @ 2022-11-24  9:19 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Haihao Xiang

From: Haihao Xiang <haihao.xiang@intel.com>

It means more than one output is ready when
MFXVideoVPP_RunFrameVPPAsync() returns MFX_ERR_MORE_SURFACE [1].
Currently the returned value from MFXVideoVPP_RunFrameVPPAsync() might
be overridden, so the check of 'ret == MFX_ERR_MORE_SURFACE' is always
false when MFX_ERR_MORE_SURFACE is returned from
MFXVideoVPP_RunFrameVPPAsync()

[1] https://github.com/Intel-Media-SDK/MediaSDK/blob/master/doc/mediasdk-man.md#video-processing-procedures

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
---
 libavfilter/qsvvpp.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/libavfilter/qsvvpp.c b/libavfilter/qsvvpp.c
index bf719b2a29..a088f6b61f 100644
--- a/libavfilter/qsvvpp.c
+++ b/libavfilter/qsvvpp.c
@@ -833,7 +833,7 @@ int ff_qsvvpp_filter_frame(QSVVPPContext *s, AVFilterLink *inlink, AVFrame *picr
     QSVAsyncFrame     aframe;
     mfxSyncPoint      sync;
     QSVFrame         *in_frame, *out_frame;
-    int               ret, filter_ret;
+    int               ret, ret1, filter_ret;
 
     while (s->eof && av_fifo_read(s->async_fifo, &aframe, 1) >= 0) {
         if (MFXVideoCORE_SyncOperation(s->session, aframe.sync, 1000) < 0)
@@ -890,8 +890,13 @@ int ff_qsvvpp_filter_frame(QSVVPPContext *s, AVFilterLink *inlink, AVFrame *picr
             av_fifo_read(s->async_fifo, &aframe, 1);
 
             do {
-                ret = MFXVideoCORE_SyncOperation(s->session, aframe.sync, 1000);
-            } while (ret == MFX_WRN_IN_EXECUTION);
+                ret1 = MFXVideoCORE_SyncOperation(s->session, aframe.sync, 1000);
+            } while (ret1 == MFX_WRN_IN_EXECUTION);
+
+            if (ret1 < 0) {
+                ret = ret1;
+                break;
+            }
 
             filter_ret = s->filter_frame(outlink, aframe.frame->frame);
             if (filter_ret < 0) {
-- 
2.25.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [FFmpeg-devel] [PATCH 3/4] lavfi/qsvvpp: provide a default framerate if needed
  2022-11-24  9:19 [FFmpeg-devel] [PATCH 1/4] lavfi/qsvvpp: change the output frame's width and height Xiang, Haihao
  2022-11-24  9:19 ` [FFmpeg-devel] [PATCH 2/4] lavfi/qsvvpp: avoid overriding the returned value Xiang, Haihao
@ 2022-11-24  9:19 ` Xiang, Haihao
  2022-11-24 19:04   ` Soft Works
  2022-11-24  9:19 ` [FFmpeg-devel] [PATCH 4/4] lavf/vf_vpp_qsv: scale_mode can be applied to color conversion Xiang, Haihao
  2022-11-24 18:57 ` [FFmpeg-devel] [PATCH 1/4] lavfi/qsvvpp: change the output frame's width and height Soft Works
  3 siblings, 1 reply; 9+ messages in thread
From: Xiang, Haihao @ 2022-11-24  9:19 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Haihao Xiang

From: Haihao Xiang <haihao.xiang@intel.com>

VPP in the SDK requires the frame rate to be set to a valid value,
otherwise init will fail, so always set a default framerate when the
input link doesn't have a valid framerate.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
---
 libavfilter/qsvvpp.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/libavfilter/qsvvpp.c b/libavfilter/qsvvpp.c
index a088f6b61f..a588a37610 100644
--- a/libavfilter/qsvvpp.c
+++ b/libavfilter/qsvvpp.c
@@ -324,6 +324,14 @@ static int fill_frameinfo_by_link(mfxFrameInfo *frameinfo, AVFilterLink *link)
     frameinfo->CropH          = link->h;
     frameinfo->FrameRateExtN  = link->frame_rate.num;
     frameinfo->FrameRateExtD  = link->frame_rate.den;
+
+    /* Apparently VPP in the SDK requires the frame rate to be set to some value, otherwise
+     * init will fail */
+    if (frameinfo->FrameRateExtD == 0 || frameinfo->FrameRateExtN == 0) {
+        frameinfo->FrameRateExtN = 25;
+        frameinfo->FrameRateExtD = 1;
+    }
+
     frameinfo->AspectRatioW   = link->sample_aspect_ratio.num ? link->sample_aspect_ratio.num : 1;
     frameinfo->AspectRatioH   = link->sample_aspect_ratio.den ? link->sample_aspect_ratio.den : 1;
 
-- 
2.25.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [FFmpeg-devel] [PATCH 4/4] lavf/vf_vpp_qsv: scale_mode can be applied to color conversion
  2022-11-24  9:19 [FFmpeg-devel] [PATCH 1/4] lavfi/qsvvpp: change the output frame's width and height Xiang, Haihao
  2022-11-24  9:19 ` [FFmpeg-devel] [PATCH 2/4] lavfi/qsvvpp: avoid overriding the returned value Xiang, Haihao
  2022-11-24  9:19 ` [FFmpeg-devel] [PATCH 3/4] lavfi/qsvvpp: provide a default framerate if needed Xiang, Haihao
@ 2022-11-24  9:19 ` Xiang, Haihao
  2022-11-24 18:47   ` Soft Works
  2022-11-24 18:57 ` [FFmpeg-devel] [PATCH 1/4] lavfi/qsvvpp: change the output frame's width and height Soft Works
  3 siblings, 1 reply; 9+ messages in thread
From: Xiang, Haihao @ 2022-11-24  9:19 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Haihao Xiang

From: Haihao Xiang <haihao.xiang@intel.com>

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
---
 libavfilter/vf_vpp_qsv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/vf_vpp_qsv.c b/libavfilter/vf_vpp_qsv.c
index 4a053f9145..17f2989245 100644
--- a/libavfilter/vf_vpp_qsv.c
+++ b/libavfilter/vf_vpp_qsv.c
@@ -492,7 +492,7 @@ static int config_output(AVFilterLink *outlink)
         }
     }
 
-    if (inlink->w != outlink->w || inlink->h != outlink->h) {
+    if (inlink->w != outlink->w || inlink->h != outlink->h || in_format != vpp->out_format) {
         if (QSV_RUNTIME_VERSION_ATLEAST(mfx_version, 1, 19)) {
             memset(&vpp->scale_conf, 0, sizeof(mfxExtVPPScaling));
             vpp->scale_conf.Header.BufferId    = MFX_EXTBUFF_VPP_SCALING;
-- 
2.25.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [FFmpeg-devel] [PATCH 4/4] lavf/vf_vpp_qsv: scale_mode can be applied to color conversion
  2022-11-24  9:19 ` [FFmpeg-devel] [PATCH 4/4] lavf/vf_vpp_qsv: scale_mode can be applied to color conversion Xiang, Haihao
@ 2022-11-24 18:47   ` Soft Works
  2022-11-25  1:39     ` Xiang, Haihao
  0 siblings, 1 reply; 9+ messages in thread
From: Soft Works @ 2022-11-24 18:47 UTC (permalink / raw)
  To: FFmpeg development discussions and patches; +Cc: Haihao Xiang



> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of
> Xiang, Haihao
> Sent: Thursday, November 24, 2022 10:20 AM
> To: ffmpeg-devel@ffmpeg.org
> Cc: Haihao Xiang <haihao.xiang@intel.com>
> Subject: [FFmpeg-devel] [PATCH 4/4] lavf/vf_vpp_qsv: scale_mode can
> be applied to color conversion
> 
> From: Haihao Xiang <haihao.xiang@intel.com>
> 
> Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
> ---
>  libavfilter/vf_vpp_qsv.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavfilter/vf_vpp_qsv.c b/libavfilter/vf_vpp_qsv.c
> index 4a053f9145..17f2989245 100644
> --- a/libavfilter/vf_vpp_qsv.c
> +++ b/libavfilter/vf_vpp_qsv.c
> @@ -492,7 +492,7 @@ static int config_output(AVFilterLink *outlink)
>          }
>      }
> 
> -    if (inlink->w != outlink->w || inlink->h != outlink->h) {
> +    if (inlink->w != outlink->w || inlink->h != outlink->h ||
> in_format != vpp->out_format) {
>          if (QSV_RUNTIME_VERSION_ATLEAST(mfx_version, 1, 19)) {
>              memset(&vpp->scale_conf, 0, sizeof(mfxExtVPPScaling));
>              vpp->scale_conf.Header.BufferId    =
> MFX_EXTBUFF_VPP_SCALING;
> --

LGTM. But maybe the warning below should be adjusted, as it would
be confusing when it says scaling even though no scaling is
configured.

softworkz
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [FFmpeg-devel] [PATCH 1/4] lavfi/qsvvpp: change the output frame's width and height
  2022-11-24  9:19 [FFmpeg-devel] [PATCH 1/4] lavfi/qsvvpp: change the output frame's width and height Xiang, Haihao
                   ` (2 preceding siblings ...)
  2022-11-24  9:19 ` [FFmpeg-devel] [PATCH 4/4] lavf/vf_vpp_qsv: scale_mode can be applied to color conversion Xiang, Haihao
@ 2022-11-24 18:57 ` Soft Works
  2022-11-25  1:52   ` Xiang, Haihao
  3 siblings, 1 reply; 9+ messages in thread
From: Soft Works @ 2022-11-24 18:57 UTC (permalink / raw)
  To: FFmpeg development discussions and patches; +Cc: Chen,Wenbin



> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of
> Xiang, Haihao
> Sent: Thursday, November 24, 2022 10:19 AM
> To: ffmpeg-devel@ffmpeg.org
> Cc: Chen,Wenbin <wenbin.chen@intel.com>
> Subject: [FFmpeg-devel] [PATCH 1/4] lavfi/qsvvpp: change the output
> frame's width and height
> 
> From: "Chen,Wenbin" <wenbin.chen@intel.com>
> 
> Make sure the size of the output frame always matches the agreed upon
> image size.
> 
> Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
> ---
>  libavfilter/qsvvpp.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/libavfilter/qsvvpp.c b/libavfilter/qsvvpp.c
> index 8428ee89ab..bf719b2a29 100644
> --- a/libavfilter/qsvvpp.c
> +++ b/libavfilter/qsvvpp.c
> @@ -487,15 +487,14 @@ static QSVFrame *query_frame(QSVVPPContext *s,
> AVFilterLink *outlink)
>          if (!out_frame->frame)
>              return NULL;
> 
> -        out_frame->frame->width  = outlink->w;
> -        out_frame->frame->height = outlink->h;
> -
>          ret = map_frame_to_surface(out_frame->frame,
>                                     &out_frame->surface);
>          if (ret < 0)
>              return NULL;
>      }
> 
> +    out_frame->frame->width  = outlink->w;
> +    out_frame->frame->height = outlink->h;
>      out_frame->surface.Info = s->vpp_param.vpp.Out;
> 
>      return out_frame;
> --

Which problem case does this address?

Thanks,
sw
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [FFmpeg-devel] [PATCH 3/4] lavfi/qsvvpp: provide a default framerate if needed
  2022-11-24  9:19 ` [FFmpeg-devel] [PATCH 3/4] lavfi/qsvvpp: provide a default framerate if needed Xiang, Haihao
@ 2022-11-24 19:04   ` Soft Works
  0 siblings, 0 replies; 9+ messages in thread
From: Soft Works @ 2022-11-24 19:04 UTC (permalink / raw)
  To: FFmpeg development discussions and patches; +Cc: Haihao Xiang



> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of
> Xiang, Haihao
> Sent: Thursday, November 24, 2022 10:19 AM
> To: ffmpeg-devel@ffmpeg.org
> Cc: Haihao Xiang <haihao.xiang@intel.com>
> Subject: [FFmpeg-devel] [PATCH 3/4] lavfi/qsvvpp: provide a default
> framerate if needed
> 
> From: Haihao Xiang <haihao.xiang@intel.com>
> 
> VPP in the SDK requires the frame rate to be set to a valid value,
> otherwise init will fail, so always set a default framerate when the
> input link doesn't have a valid framerate.
> 
> Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
> ---
>  libavfilter/qsvvpp.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/libavfilter/qsvvpp.c b/libavfilter/qsvvpp.c
> index a088f6b61f..a588a37610 100644
> --- a/libavfilter/qsvvpp.c
> +++ b/libavfilter/qsvvpp.c
> @@ -324,6 +324,14 @@ static int fill_frameinfo_by_link(mfxFrameInfo
> *frameinfo, AVFilterLink *link)
>      frameinfo->CropH          = link->h;
>      frameinfo->FrameRateExtN  = link->frame_rate.num;
>      frameinfo->FrameRateExtD  = link->frame_rate.den;
> +
> +    /* Apparently VPP in the SDK requires the frame rate to be set
> to some value, otherwise
> +     * init will fail */
> +    if (frameinfo->FrameRateExtD == 0 || frameinfo->FrameRateExtN ==
> 0) {
> +        frameinfo->FrameRateExtN = 25;
> +        frameinfo->FrameRateExtD = 1;
> +    }
> +
>      frameinfo->AspectRatioW   = link->sample_aspect_ratio.num ?
> link->sample_aspect_ratio.num : 1;
>      frameinfo->AspectRatioH   = link->sample_aspect_ratio.den ?
> link->sample_aspect_ratio.den : 1;
> 
> --

LGTM. I have this in place for about a year.

softworkz
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [FFmpeg-devel] [PATCH 4/4] lavf/vf_vpp_qsv: scale_mode can be applied to color conversion
  2022-11-24 18:47   ` Soft Works
@ 2022-11-25  1:39     ` Xiang, Haihao
  0 siblings, 0 replies; 9+ messages in thread
From: Xiang, Haihao @ 2022-11-25  1:39 UTC (permalink / raw)
  To: ffmpeg-devel, softworkz

On Thu, 2022-11-24 at 18:47 +0000, Soft Works wrote:
> > -----Original Message-----
> > From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of
> > Xiang, Haihao
> > Sent: Thursday, November 24, 2022 10:20 AM
> > To: ffmpeg-devel@ffmpeg.org
> > Cc: Haihao Xiang <haihao.xiang@intel.com>
> > Subject: [FFmpeg-devel] [PATCH 4/4] lavf/vf_vpp_qsv: scale_mode can
> > be applied to color conversion
> > 
> > From: Haihao Xiang <haihao.xiang@intel.com>
> > 
> > Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
> > ---
> >  libavfilter/vf_vpp_qsv.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/libavfilter/vf_vpp_qsv.c b/libavfilter/vf_vpp_qsv.c
> > index 4a053f9145..17f2989245 100644
> > --- a/libavfilter/vf_vpp_qsv.c
> > +++ b/libavfilter/vf_vpp_qsv.c
> > @@ -492,7 +492,7 @@ static int config_output(AVFilterLink *outlink)
> >          }
> >      }
> > 
> > -    if (inlink->w != outlink->w || inlink->h != outlink->h) {
> > +    if (inlink->w != outlink->w || inlink->h != outlink->h ||
> > in_format != vpp->out_format) {
> >          if (QSV_RUNTIME_VERSION_ATLEAST(mfx_version, 1, 19)) {
> >              memset(&vpp->scale_conf, 0, sizeof(mfxExtVPPScaling));
> >              vpp->scale_conf.Header.BufferId    =
> > MFX_EXTBUFF_VPP_SCALING;
> > --
> 
> LGTM. But maybe the warning below should be adjusted, as it would
> be confusing when it says scaling even though no scaling is
> configured.
> 

Thanks, I'll update the comment.

-Haihao

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [FFmpeg-devel] [PATCH 1/4] lavfi/qsvvpp: change the output frame's width and height
  2022-11-24 18:57 ` [FFmpeg-devel] [PATCH 1/4] lavfi/qsvvpp: change the output frame's width and height Soft Works
@ 2022-11-25  1:52   ` Xiang, Haihao
  0 siblings, 0 replies; 9+ messages in thread
From: Xiang, Haihao @ 2022-11-25  1:52 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Chen, Wenbin

On Thu, 2022-11-24 at 18:57 +0000, Soft Works wrote:
> > -----Original Message-----
> > From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of
> > Xiang, Haihao
> > Sent: Thursday, November 24, 2022 10:19 AM
> > To: ffmpeg-devel@ffmpeg.org
> > Cc: Chen,Wenbin <wenbin.chen@intel.com>
> > Subject: [FFmpeg-devel] [PATCH 1/4] lavfi/qsvvpp: change the output
> > frame's width and height
> > 
> > From: "Chen,Wenbin" <wenbin.chen@intel.com>
> > 
> > Make sure the size of the output frame always matches the agreed upon
> > image size.
> > 
> > Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
> > ---
> >  libavfilter/qsvvpp.c | 5 ++---
> >  1 file changed, 2 insertions(+), 3 deletions(-)
> > 
> > diff --git a/libavfilter/qsvvpp.c b/libavfilter/qsvvpp.c
> > index 8428ee89ab..bf719b2a29 100644
> > --- a/libavfilter/qsvvpp.c
> > +++ b/libavfilter/qsvvpp.c
> > @@ -487,15 +487,14 @@ static QSVFrame *query_frame(QSVVPPContext *s,
> > AVFilterLink *outlink)
> >          if (!out_frame->frame)
> >              return NULL;
> > 
> > -        out_frame->frame->width  = outlink->w;
> > -        out_frame->frame->height = outlink->h;
> > -
> >          ret = map_frame_to_surface(out_frame->frame,
> >                                     &out_frame->surface);
> >          if (ret < 0)
> >              return NULL;
> >      }
> > 
> > +    out_frame->frame->width  = outlink->w;
> > +    out_frame->frame->height = outlink->h;
> >      out_frame->surface.Info = s->vpp_param.vpp.Out;
> > 
> >      return out_frame;
> > --
> 
> Which problem case does this address?

av_hwframe_get_buffer() gets a frame with aligned dimension, the filtered_frame
dimension might not be the expected one if don't reset width and height to the
agreed image width and height. E.g. the filtered frame is 1920x1088, not
1920x1080 in the following command

$ ffmpeg -hwaccel qsv -i input.mp4 -vf "vpp_qsv=w=1920:h=1080" -f null -

Thanks
Haihao

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-11-25  1:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-24  9:19 [FFmpeg-devel] [PATCH 1/4] lavfi/qsvvpp: change the output frame's width and height Xiang, Haihao
2022-11-24  9:19 ` [FFmpeg-devel] [PATCH 2/4] lavfi/qsvvpp: avoid overriding the returned value Xiang, Haihao
2022-11-24  9:19 ` [FFmpeg-devel] [PATCH 3/4] lavfi/qsvvpp: provide a default framerate if needed Xiang, Haihao
2022-11-24 19:04   ` Soft Works
2022-11-24  9:19 ` [FFmpeg-devel] [PATCH 4/4] lavf/vf_vpp_qsv: scale_mode can be applied to color conversion Xiang, Haihao
2022-11-24 18:47   ` Soft Works
2022-11-25  1:39     ` Xiang, Haihao
2022-11-24 18:57 ` [FFmpeg-devel] [PATCH 1/4] lavfi/qsvvpp: change the output frame's width and height Soft Works
2022-11-25  1:52   ` Xiang, Haihao

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git