* [FFmpeg-devel] [PATCH] lavfi: add hwdevice flag to hwupload/hwdownload/hwmap
@ 2023-03-24 14:39 U. Artie Eoff
2023-03-24 15:48 ` Anton Khirnov
0 siblings, 1 reply; 3+ messages in thread
From: U. Artie Eoff @ 2023-03-24 14:39 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: U. Artie Eoff
This fixes a regression introduced by:
commit 3f63685c3554aea7f72bab1fdbde440820816d37
and
commit 632c34993195f716e9fa575af3de80d07fd50991
...where command-lines like:
ffmpeg -v verbose -hwaccel qsv \
-init_hw_device qsv=qsv,child_device=/dev/dri/renderD128 \
-hwaccel_output_format qsv -f rawvideo -pix_fmt yuv420p \
-s:v 352x288 -r:v 25 -i input.yuv \
-vf 'format=nv12,hwupload=extra_hw_frames=120' \
-an -c:v h264_qsv -y output.h264
ffmpeg -v verbose -hwaccel qsv \
-init_hw_device qsv=qsv,child_device=/dev/dri/renderD128 \
-hwaccel_output_format qsv -f rawvideo -pix_fmt nv12 \
-s:v 352x288 -r:v 25 -i input.yuv \
-vf 'format=nv12|qsv,hwupload=extra_hw_frames=16,vpp_qsv=procamp=1:saturation=1.0,hwdownload,format=nv12' \
-pix_fmt nv12 -f rawvideo -fps_mode passthrough -an -y output.yuv
...produced errors like:
[hwupload @ 0x55b6171d0dc0] A hardware device reference is required to upload frames to.
[Parsed_hwupload_1 @ 0x55b6172053c0] Query format failed for 'Parsed_hwupload_1': Invalid argument
Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
---
libavfilter/vf_hwdownload.c | 1 +
libavfilter/vf_hwmap.c | 1 +
libavfilter/vf_hwupload.c | 1 +
3 files changed, 3 insertions(+)
diff --git a/libavfilter/vf_hwdownload.c b/libavfilter/vf_hwdownload.c
index 5ef23cb5d465..8e8044d5bc0a 100644
--- a/libavfilter/vf_hwdownload.c
+++ b/libavfilter/vf_hwdownload.c
@@ -199,4 +199,5 @@ const AVFilter ff_vf_hwdownload = {
FILTER_OUTPUTS(hwdownload_outputs),
FILTER_QUERY_FUNC(hwdownload_query_formats),
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
+ .flags = AVFILTER_FLAG_HWDEVICE,
};
diff --git a/libavfilter/vf_hwmap.c b/libavfilter/vf_hwmap.c
index 2e03dfc1fec7..e246b22603b5 100644
--- a/libavfilter/vf_hwmap.c
+++ b/libavfilter/vf_hwmap.c
@@ -427,4 +427,5 @@ const AVFilter ff_vf_hwmap = {
FILTER_OUTPUTS(hwmap_outputs),
FILTER_QUERY_FUNC(hwmap_query_formats),
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
+ .flags = AVFILTER_FLAG_HWDEVICE,
};
diff --git a/libavfilter/vf_hwupload.c b/libavfilter/vf_hwupload.c
index dbc41734ccc3..ef61bb413757 100644
--- a/libavfilter/vf_hwupload.c
+++ b/libavfilter/vf_hwupload.c
@@ -258,4 +258,5 @@ const AVFilter ff_vf_hwupload = {
FILTER_OUTPUTS(hwupload_outputs),
FILTER_QUERY_FUNC(hwupload_query_formats),
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
+ .flags = AVFILTER_FLAG_HWDEVICE,
};
--
2.38.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] 3+ messages in thread
* Re: [FFmpeg-devel] [PATCH] lavfi: add hwdevice flag to hwupload/hwdownload/hwmap
2023-03-24 14:39 [FFmpeg-devel] [PATCH] lavfi: add hwdevice flag to hwupload/hwdownload/hwmap U. Artie Eoff
@ 2023-03-24 15:48 ` Anton Khirnov
2023-03-24 16:06 ` Eoff, Ullysses A
0 siblings, 1 reply; 3+ messages in thread
From: Anton Khirnov @ 2023-03-24 15:48 UTC (permalink / raw)
To: FFmpeg development discussions and patches; +Cc: U. Artie Eoff
Quoting U. Artie Eoff (2023-03-24 15:39:16)
> This fixes a regression introduced by:
>
> commit 3f63685c3554aea7f72bab1fdbde440820816d37
> and
> commit 632c34993195f716e9fa575af3de80d07fd50991
>
> ...where command-lines like:
>
> ffmpeg -v verbose -hwaccel qsv \
> -init_hw_device qsv=qsv,child_device=/dev/dri/renderD128 \
> -hwaccel_output_format qsv -f rawvideo -pix_fmt yuv420p \
> -s:v 352x288 -r:v 25 -i input.yuv \
> -vf 'format=nv12,hwupload=extra_hw_frames=120' \
> -an -c:v h264_qsv -y output.h264
>
> ffmpeg -v verbose -hwaccel qsv \
> -init_hw_device qsv=qsv,child_device=/dev/dri/renderD128 \
> -hwaccel_output_format qsv -f rawvideo -pix_fmt nv12 \
> -s:v 352x288 -r:v 25 -i input.yuv \
> -vf 'format=nv12|qsv,hwupload=extra_hw_frames=16,vpp_qsv=procamp=1:saturation=1.0,hwdownload,format=nv12' \
> -pix_fmt nv12 -f rawvideo -fps_mode passthrough -an -y output.yuv
>
> ...produced errors like:
>
> [hwupload @ 0x55b6171d0dc0] A hardware device reference is required to upload frames to.
> [Parsed_hwupload_1 @ 0x55b6172053c0] Query format failed for 'Parsed_hwupload_1': Invalid argument
> Error reinitializing filters!
> Failed to inject frame into filter network: Invalid argument
>
> Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
> ---
> libavfilter/vf_hwdownload.c | 1 +
> libavfilter/vf_hwmap.c | 1 +
> libavfilter/vf_hwupload.c | 1 +
> 3 files changed, 3 insertions(+)
>
> diff --git a/libavfilter/vf_hwdownload.c b/libavfilter/vf_hwdownload.c
> index 5ef23cb5d465..8e8044d5bc0a 100644
> --- a/libavfilter/vf_hwdownload.c
> +++ b/libavfilter/vf_hwdownload.c
> @@ -199,4 +199,5 @@ const AVFilter ff_vf_hwdownload = {
> FILTER_OUTPUTS(hwdownload_outputs),
> FILTER_QUERY_FUNC(hwdownload_query_formats),
> .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
> + .flags = AVFILTER_FLAG_HWDEVICE,
I don't think hwdownload should be flagged, I don't see it using
hw_device_ctx anywhere. Not that this flags is just for filters using
that specific field, not all hardware filters in general.
> };
> diff --git a/libavfilter/vf_hwmap.c b/libavfilter/vf_hwmap.c
> index 2e03dfc1fec7..e246b22603b5 100644
> --- a/libavfilter/vf_hwmap.c
> +++ b/libavfilter/vf_hwmap.c
> @@ -427,4 +427,5 @@ const AVFilter ff_vf_hwmap = {
> FILTER_OUTPUTS(hwmap_outputs),
> FILTER_QUERY_FUNC(hwmap_query_formats),
> .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
> + .flags = AVFILTER_FLAG_HWDEVICE,
> };
> diff --git a/libavfilter/vf_hwupload.c b/libavfilter/vf_hwupload.c
> index dbc41734ccc3..ef61bb413757 100644
> --- a/libavfilter/vf_hwupload.c
> +++ b/libavfilter/vf_hwupload.c
> @@ -258,4 +258,5 @@ const AVFilter ff_vf_hwupload = {
> FILTER_OUTPUTS(hwupload_outputs),
> FILTER_QUERY_FUNC(hwupload_query_formats),
> .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
> + .flags = AVFILTER_FLAG_HWDEVICE,
> };
Huh, wonder how I missed those. I do remember looking at them.
In any case, thank you for finding these.
--
Anton Khirnov
_______________________________________________
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] 3+ messages in thread
* Re: [FFmpeg-devel] [PATCH] lavfi: add hwdevice flag to hwupload/hwdownload/hwmap
2023-03-24 15:48 ` Anton Khirnov
@ 2023-03-24 16:06 ` Eoff, Ullysses A
0 siblings, 0 replies; 3+ messages in thread
From: Eoff, Ullysses A @ 2023-03-24 16:06 UTC (permalink / raw)
To: FFmpeg development discussions and patches
> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of Anton Khirnov
> Sent: Friday, March 24, 2023 11:49 AM
> To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
> Cc: Eoff, Ullysses A <ullysses.a.eoff@intel.com>
> Subject: Re: [FFmpeg-devel] [PATCH] lavfi: add hwdevice flag to hwupload/hwdownload/hwmap
>
> Quoting U. Artie Eoff (2023-03-24 15:39:16)
> > This fixes a regression introduced by:
> >
> > commit 3f63685c3554aea7f72bab1fdbde440820816d37
> > and
> > commit 632c34993195f716e9fa575af3de80d07fd50991
> >
> > ...where command-lines like:
> >
> > ffmpeg -v verbose -hwaccel qsv \
> > -init_hw_device qsv=qsv,child_device=/dev/dri/renderD128 \
> > -hwaccel_output_format qsv -f rawvideo -pix_fmt yuv420p \
> > -s:v 352x288 -r:v 25 -i input.yuv \
> > -vf 'format=nv12,hwupload=extra_hw_frames=120' \
> > -an -c:v h264_qsv -y output.h264
> >
> > ffmpeg -v verbose -hwaccel qsv \
> > -init_hw_device qsv=qsv,child_device=/dev/dri/renderD128 \
> > -hwaccel_output_format qsv -f rawvideo -pix_fmt nv12 \
> > -s:v 352x288 -r:v 25 -i input.yuv \
> > -vf 'format=nv12|qsv,hwupload=extra_hw_frames=16,vpp_qsv=procamp=1:saturation=1.0,hwdownload,format=nv12' \
> > -pix_fmt nv12 -f rawvideo -fps_mode passthrough -an -y output.yuv
> >
> > ...produced errors like:
> >
> > [hwupload @ 0x55b6171d0dc0] A hardware device reference is required to upload frames to.
> > [Parsed_hwupload_1 @ 0x55b6172053c0] Query format failed for 'Parsed_hwupload_1': Invalid argument
> > Error reinitializing filters!
> > Failed to inject frame into filter network: Invalid argument
> >
> > Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
> > ---
> > libavfilter/vf_hwdownload.c | 1 +
> > libavfilter/vf_hwmap.c | 1 +
> > libavfilter/vf_hwupload.c | 1 +
> > 3 files changed, 3 insertions(+)
> >
> > diff --git a/libavfilter/vf_hwdownload.c b/libavfilter/vf_hwdownload.c
> > index 5ef23cb5d465..8e8044d5bc0a 100644
> > --- a/libavfilter/vf_hwdownload.c
> > +++ b/libavfilter/vf_hwdownload.c
> > @@ -199,4 +199,5 @@ const AVFilter ff_vf_hwdownload = {
> > FILTER_OUTPUTS(hwdownload_outputs),
> > FILTER_QUERY_FUNC(hwdownload_query_formats),
> > .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
> > + .flags = AVFILTER_FLAG_HWDEVICE,
>
> I don't think hwdownload should be flagged, I don't see it using
> hw_device_ctx anywhere. Not that this flags is just for filters using
> that specific field, not all hardware filters in general.
>
[UAE] Ok. I will verify it locally without it and provide an
update (v2) as needed.
> > };
> > diff --git a/libavfilter/vf_hwmap.c b/libavfilter/vf_hwmap.c
> > index 2e03dfc1fec7..e246b22603b5 100644
> > --- a/libavfilter/vf_hwmap.c
> > +++ b/libavfilter/vf_hwmap.c
> > @@ -427,4 +427,5 @@ const AVFilter ff_vf_hwmap = {
> > FILTER_OUTPUTS(hwmap_outputs),
> > FILTER_QUERY_FUNC(hwmap_query_formats),
> > .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
> > + .flags = AVFILTER_FLAG_HWDEVICE,
> > };
> > diff --git a/libavfilter/vf_hwupload.c b/libavfilter/vf_hwupload.c
> > index dbc41734ccc3..ef61bb413757 100644
> > --- a/libavfilter/vf_hwupload.c
> > +++ b/libavfilter/vf_hwupload.c
> > @@ -258,4 +258,5 @@ const AVFilter ff_vf_hwupload = {
> > FILTER_OUTPUTS(hwupload_outputs),
> > FILTER_QUERY_FUNC(hwupload_query_formats),
> > .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
> > + .flags = AVFILTER_FLAG_HWDEVICE,
> > };
>
> Huh, wonder how I missed those. I do remember looking at them.
>
> In any case, thank you for finding these.
>
> --
> Anton Khirnov
> _______________________________________________
> 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".
_______________________________________________
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] 3+ messages in thread
end of thread, other threads:[~2023-03-24 16:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-24 14:39 [FFmpeg-devel] [PATCH] lavfi: add hwdevice flag to hwupload/hwdownload/hwmap U. Artie Eoff
2023-03-24 15:48 ` Anton Khirnov
2023-03-24 16:06 ` Eoff, Ullysses A
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