Re: [FFmpeg-user] Trouble selecting a pixel format/colorspace while trying to encode a video using ffmpeg and HW accelerated vaapi or qsv interfaces

2022-12-11 Thread caetano
  The second link in my last message is wrong, the correct one with the
summary of the media features for Intel GPUs is:

https://github.com/intel/media-driver/blob/master/docs/media_features.md

On Sun, 11 Dec 2022 at 18:44,  wrote:

>   My question is not related to post-processing or color-space
> transformation. It is about how to hardware encode using a pixel format
> that provides high color accuracy for screen capture, differently from what
> NV12 is capable of offering.
>
>   Regarding hardware encoding support, accordingly to this:
>
> https://github.com/intel/media-driver/blob/master/README.md
>
>   Hardware support has been added since Ice Lake (2019, 10th generation) to
> HEVC and VP9 codecs for 4:4:4 chroma for both 8 and 10 bits modes and also
> for both encoding and decoding.
>
>   This other page gives more details:
>
> https://github.com/intel/media-driver/blob/master/README.md
>
>   Accordingly to the above link , the following 4:4:4 formats are supported
> for hardware decoding when using HEVC or VP9: AYUV (8 bits) and Y410 (10
> bits) and the following  4:4:4 formats are supported for hardware encoding
> when using HEVC or VP9: AYUV and RGB (8 bits) and Y410 (10 bits).
>
>   I've found out that gstreamer in my system (ubuntu version 1.20.1) is
> able to perform 4:4:4 10 bits encoding when using the Y410 format and the
> following command (ffprobe for the generated file reports pixel format
> as yuv444p10le):
>
> 
> gst-launch-1.0 ximagesrc display-name=:0.0 show-pointer=false
> use-damage=false num-buffers=2400 ! video/x-raw,framerate=20/1 !
> videoconvert ! video/x-raw,format=RGBx ! vaapipostproc !
> video/x-raw,format=Y410 ! vaapih265enc rate-control=cqp quality-level=1
> quality-factor=18 ! video/x-h265 ! h265parse ! matroskamux ! filesink
> location=desktop.mkv
> 
>
> and hardware decoding of the above generated file can be achieved with the
> following command:
>
> 
> gst-play-1.0 desktop.mkv
> 
>
> Unfortunately, gstreamer version I have has no support for the AYUV pixel
> format with hardware acceleration, therefore I could not test 8 bits
> hardware encoding and decoding, but at least for 10 bits it is working
> properly and colors looks just great.
>
> ===
>
> I believe it would be great to add support in ffmpeg for hardware encoding
> and decoding for at least the following 4:4:4 pixel formats: AYUV, RGB
> and Y410 as this is available in Intel hardware since 2019.
>
>
>
> On Sat, 10 Dec 2022 at 17:00, Carl Eugen Hoyos  wrote:
>
> > I wanted to write "no hardware encoders support full chroma" and
> > "no hardware encoders support RGB" - Wenbin's answer seems
> > to indicate that I was wrong but in any case the qsv code in FFmpeg
> > currently neither allows full-chroma encoding nor RGB encoding.
> >
> > I don't know if mxf (the library used for qsv encoding) support
> > full-chroma and RGB.
> >
> > No idea how your question could be related to post-processing
> > or colour-space transformation.
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

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


Re: [FFmpeg-user] Trouble selecting a pixel format/colorspace while trying to encode a video using ffmpeg and HW accelerated vaapi or qsv interfaces

2022-12-11 Thread caetano
  My question is not related to post-processing or color-space
transformation. It is about how to hardware encode using a pixel format
that provides high color accuracy for screen capture, differently from what
NV12 is capable of offering.

  Regarding hardware encoding support, accordingly to this:

https://github.com/intel/media-driver/blob/master/README.md

  Hardware support has been added since Ice Lake (2019, 10th generation) to
HEVC and VP9 codecs for 4:4:4 chroma for both 8 and 10 bits modes and also
for both encoding and decoding.

  This other page gives more details:

https://github.com/intel/media-driver/blob/master/README.md

  Accordingly to the above link , the following 4:4:4 formats are supported
for hardware decoding when using HEVC or VP9: AYUV (8 bits) and Y410 (10
bits) and the following  4:4:4 formats are supported for hardware encoding
when using HEVC or VP9: AYUV and RGB (8 bits) and Y410 (10 bits).

  I've found out that gstreamer in my system (ubuntu version 1.20.1) is
able to perform 4:4:4 10 bits encoding when using the Y410 format and the
following command (ffprobe for the generated file reports pixel format
as yuv444p10le):


gst-launch-1.0 ximagesrc display-name=:0.0 show-pointer=false
use-damage=false num-buffers=2400 ! video/x-raw,framerate=20/1 !
videoconvert ! video/x-raw,format=RGBx ! vaapipostproc !
video/x-raw,format=Y410 ! vaapih265enc rate-control=cqp quality-level=1
quality-factor=18 ! video/x-h265 ! h265parse ! matroskamux ! filesink
location=desktop.mkv


and hardware decoding of the above generated file can be achieved with the
following command:


gst-play-1.0 desktop.mkv


Unfortunately, gstreamer version I have has no support for the AYUV pixel
format with hardware acceleration, therefore I could not test 8 bits
hardware encoding and decoding, but at least for 10 bits it is working
properly and colors looks just great.

===

I believe it would be great to add support in ffmpeg for hardware encoding
and decoding for at least the following 4:4:4 pixel formats: AYUV, RGB
and Y410 as this is available in Intel hardware since 2019.



On Sat, 10 Dec 2022 at 17:00, Carl Eugen Hoyos  wrote:

> I wanted to write "no hardware encoders support full chroma" and
> "no hardware encoders support RGB" - Wenbin's answer seems
> to indicate that I was wrong but in any case the qsv code in FFmpeg
> currently neither allows full-chroma encoding nor RGB encoding.
>
> I don't know if mxf (the library used for qsv encoding) support
> full-chroma and RGB.
>
> No idea how your question could be related to post-processing
> or colour-space transformation.
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

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


Re: [FFmpeg-user] Trouble selecting a pixel format/colorspace while trying to encode a video using ffmpeg and HW accelerated vaapi or qsv interfaces

2022-12-10 Thread Carl Eugen Hoyos
Am Do., 8. Dez. 2022 um 20:32 Uhr schrieb :

>   Stream #0:0: Video: hevc (Rext), gbrp

Completely unrelated:
Do all your video players play above file?

> ffmpeg -init_hw_device qsv=hw -filter_hw_device hw -v verbose
> -f x11grab -draw_mouse 0 -framerate 20 -probesize 42M
> -video_size 1920x1200 -thread_queue_size 1000 -vcodec rawvideo
> -i ":0.0" -an -vf 'hwupload=extra_hw_frames=64,scale_qsv=format=bgra'
> -c:v hevc_qsv -preset veryslow -global_quality 17 -look_ahead 1
> -y /tmp/output.mkv

(-vcodec rawvideo looks wrong)

When asking for support on this mailing list, always provide the command
line you tested together with the complete, uncut console output.

> As you can see, in the first example, libx265 SW encoder based, the output
> is generated with the "gbrp" colorspace while in the second example,
> hevc_qsv HW encoder based, the output is generated with the "yuvj420p"
> pixel format.

I wanted to write "no hardware encoders support full chroma" and
"no hardware encoders support RGB" - Wenbin's answer seems
to indicate that I was wrong but in any case the qsv code in FFmpeg
currently neither allows full-chroma encoding nor RGB encoding.

I don't know if mxf (the library used for qsv encoding) support
full-chroma and RGB.

No idea how your question could be related to post-processing
or colour-space transformation.

Carl Eugen
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

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


Re: [FFmpeg-user] Trouble selecting a pixel format/colorspace while trying to encode a video using ffmpeg and HW accelerated vaapi or qsv interfaces

2022-12-09 Thread Dennis Mungai
On Fri, 9 Dec 2022 at 09:16, Chen, Wenbin <
wenbin.chen-at-intel@ffmpeg.org> wrote:

> > > Output of 'ffmpeg -h filter=vpp_qsv' is bellow
> > >
> > > 
> > > Filter vpp_qsv
> > >   Quick Sync Video VPP.
> > > Inputs:
> > >#0: default (video)
> > > Outputs:
> > >#0: default (video)
> > > vpp_qsv AVOptions:
> > >deinterlace   ..FV... deinterlace mode: 0=off,
> 1=bob,
> > > 2=advanced (from 0 to 2) (default 0)
> > >  bob 1..FV... Bob deinterlace mode.
> > >  advanced2..FV... Advanced deinterlace
> mode.
> > >denoise   ..FV... denoise level [0, 100]
> (from 0
> > > to 100) (default 0)
> > >detail..FV... enhancement level [0,
> 100] (from
> > > 0 to 100) (default 0)
> > >framerate..FV... output framerate (from 0
> to
> > > DBL_MAX) (default 0/1)
> > >procamp   ..FV... Enable ProcAmp (from 0
> to 1)
> > > (default 0)
> > >hue ..FV... ProcAmp hue (from -180
> to 180)
> > > (default 0)
> > >saturation  ..FV... ProcAmp saturation (from
> 0 to
> > > 10) (default 1)
> > >contrast..FV... ProcAmp contrast (from 0
> to 10)
> > > (default 1)
> > >brightness  ..FV... ProcAmp brightness (from
> -100 to
> > > 100) (default 0)
> > >transpose ..FV... set transpose direction
> (from -1
> > > to 6) (default -1)
> > >  cclock_hflip0..FV... rotate counter-clockwise
> with
> > > horizontal flip
> > >  clock   1..FV... rotate clockwise
> > >  cclock  2..FV... rotate counter-clockwise
> > >  clock_hflip 3..FV... rotate clockwise with
> horizontal
> > > flip
> > >  reversal4..FV... rotate by half-turn
> > >  hflip   5..FV... flip horizontally
> > >  vflip   6..FV... flip vertically
> > >cw ..FV... set the width crop area
> > > expression (default "iw")
> > >ch ..FV... set the height crop area
> > > expression (default "ih")
> > >cx ..FV... set the x crop area
> expression
> > > (default "(in_w-out_w)/2")
> > >cy ..FV... set the y crop area
> expression
> > > (default "(in_h-out_h)/2")
> > >w  ..FV... Output video width
> (default
> > > "cw")
> > >width  ..FV... Output video width
> (default
> > > "cw")
> > >h  ..FV... Output video height
> (default
> > > "w*ch/cw")
> > >height ..FV... Output video height
> (default
> > > "w*ch/cw")
> > >format ..FV... Output pixel format
> (default
> > > "same")
> > >async_depth   ..FV... Internal parallelization
> depth,
> > > the higher the value the higher the latency. (from 0 to INT_MAX)
> (default 0)
> > >scale_mode..FV... scale mode: 0=auto,
> 1=low power,
> > > 2=high quality (from 0 to 2) (default 0)
> > > 
> > >
> > > I tried the following command with vpp_qsv filter but pixel
> > format/colorspace
> > > of the output is the same:
> > >
> > > 
> > > ffmpeg -init_hw_device qsv=hw -filter_hw_device hw -v verbose -f
> x11grab
> > > -draw_mouse 0 -framerate 20 -probesize 42M -video_size 1920x1200
> > > -thread_queue_size 1000 -vcodec rawvideo -i ":0.0" -an -vf
> > > 'hwupload=extra_hw_frames=64,vpp_qsv=format=bgra' -c:v hevc_qsv -
> > preset
> > > veryslow -global_quality 17 -look_ahead 1 -y /tmp/output.mkv
> > > 
> > >
> > > The ffprobe result for the above command is:
> > >
> > > 
> > > Input #0, matroska,webm, from '/tmp/output.mkv':
> > >   Metadata:
> > > ENCODER : Lavf59.27.100
> > >   Duration: 00:00:04.85, start: 0.00, bitrate: 50 kb/s
> > >   Stream #0:0: Video: hevc (Main), yuvj420p(pc, gbr/unknown/unknown,
> > > progressive), 1920x1200 [SAR 1:1 DAR 8:5], 20 fps, 20 tbr, 1k tbn
> > > Metadata:
> > >   ENCODER : Lavc59.37.100 hevc_qsv
> > >   DURATION: 00:00:04.85000
> > > 
> > >
> > > On Thu, 8 Dec 2022 at 17:06, Dennis Mungai  wrote:
>
> In case of RGB input, VPL/MSDK uses 420 chroma format as default for the
> purpose of backward compatibility.
> I will send patch to enable 444 encoding for RGB input, then you can get
> the same output as libx265 SW.
>
> Thanks
> Wenbin
>
> > >
> > > > Hey there,
> > > >
> > > > I'd recommend using the vpp_qsv filter instead.
> > > >
> > > > Please provide the output of:
> > > >
> > > > ffmpeg -h filter=vpp_qsv
> > > >
> > > > And I'll generate a command line you can use to test and report back.
>
>
Perhaps we can try out libplacebo.

That vulkan-based filter should have support for the output format(s)

Re: [FFmpeg-user] Trouble selecting a pixel format/colorspace while trying to encode a video using ffmpeg and HW accelerated vaapi or qsv interfaces

2022-12-08 Thread Chen, Wenbin
> > Output of 'ffmpeg -h filter=vpp_qsv' is bellow
> >
> > 
> > Filter vpp_qsv
> >   Quick Sync Video VPP.
> > Inputs:
> >#0: default (video)
> > Outputs:
> >#0: default (video)
> > vpp_qsv AVOptions:
> >deinterlace   ..FV... deinterlace mode: 0=off, 
> > 1=bob,
> > 2=advanced (from 0 to 2) (default 0)
> >  bob 1..FV... Bob deinterlace mode.
> >  advanced2..FV... Advanced deinterlace mode.
> >denoise   ..FV... denoise level [0, 100] (from 0
> > to 100) (default 0)
> >detail..FV... enhancement level [0, 100] 
> > (from
> > 0 to 100) (default 0)
> >framerate..FV... output framerate (from 0 to
> > DBL_MAX) (default 0/1)
> >procamp   ..FV... Enable ProcAmp (from 0 to 1)
> > (default 0)
> >hue ..FV... ProcAmp hue (from -180 to 180)
> > (default 0)
> >saturation  ..FV... ProcAmp saturation (from 0 to
> > 10) (default 1)
> >contrast..FV... ProcAmp contrast (from 0 to 
> > 10)
> > (default 1)
> >brightness  ..FV... ProcAmp brightness (from -100 
> > to
> > 100) (default 0)
> >transpose ..FV... set transpose direction (from 
> > -1
> > to 6) (default -1)
> >  cclock_hflip0..FV... rotate counter-clockwise with
> > horizontal flip
> >  clock   1..FV... rotate clockwise
> >  cclock  2..FV... rotate counter-clockwise
> >  clock_hflip 3..FV... rotate clockwise with 
> > horizontal
> > flip
> >  reversal4..FV... rotate by half-turn
> >  hflip   5..FV... flip horizontally
> >  vflip   6..FV... flip vertically
> >cw ..FV... set the width crop area
> > expression (default "iw")
> >ch ..FV... set the height crop area
> > expression (default "ih")
> >cx ..FV... set the x crop area expression
> > (default "(in_w-out_w)/2")
> >cy ..FV... set the y crop area expression
> > (default "(in_h-out_h)/2")
> >w  ..FV... Output video width (default
> > "cw")
> >width  ..FV... Output video width (default
> > "cw")
> >h  ..FV... Output video height (default
> > "w*ch/cw")
> >height ..FV... Output video height (default
> > "w*ch/cw")
> >format ..FV... Output pixel format (default
> > "same")
> >async_depth   ..FV... Internal parallelization 
> > depth,
> > the higher the value the higher the latency. (from 0 to INT_MAX) (default 0)
> >scale_mode..FV... scale mode: 0=auto, 1=low 
> > power,
> > 2=high quality (from 0 to 2) (default 0)
> > 
> >
> > I tried the following command with vpp_qsv filter but pixel
> format/colorspace
> > of the output is the same:
> >
> > 
> > ffmpeg -init_hw_device qsv=hw -filter_hw_device hw -v verbose -f x11grab
> > -draw_mouse 0 -framerate 20 -probesize 42M -video_size 1920x1200
> > -thread_queue_size 1000 -vcodec rawvideo -i ":0.0" -an -vf
> > 'hwupload=extra_hw_frames=64,vpp_qsv=format=bgra' -c:v hevc_qsv -
> preset
> > veryslow -global_quality 17 -look_ahead 1 -y /tmp/output.mkv
> > 
> >
> > The ffprobe result for the above command is:
> >
> > 
> > Input #0, matroska,webm, from '/tmp/output.mkv':
> >   Metadata:
> > ENCODER : Lavf59.27.100
> >   Duration: 00:00:04.85, start: 0.00, bitrate: 50 kb/s
> >   Stream #0:0: Video: hevc (Main), yuvj420p(pc, gbr/unknown/unknown,
> > progressive), 1920x1200 [SAR 1:1 DAR 8:5], 20 fps, 20 tbr, 1k tbn
> > Metadata:
> >   ENCODER : Lavc59.37.100 hevc_qsv
> >   DURATION: 00:00:04.85000
> > 
> >
> > On Thu, 8 Dec 2022 at 17:06, Dennis Mungai  wrote:

In case of RGB input, VPL/MSDK uses 420 chroma format as default for the 
purpose of backward compatibility.
I will send patch to enable 444 encoding for RGB input, then you can get the 
same output as libx265 SW.

Thanks
Wenbin

> >
> > > Hey there,
> > >
> > > I'd recommend using the vpp_qsv filter instead.
> > >
> > > Please provide the output of:
> > >
> > > ffmpeg -h filter=vpp_qsv
> > >
> > > And I'll generate a command line you can use to test and report back.
> > ___
> > ffmpeg-user mailing list
> > ffmpeg-user@ffmpeg.org
> > https://ffmpeg.org/mailman/listinfo/ffmpeg-user
> >
> > To unsubscribe, visit link above, or email
> > ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To 

Re: [FFmpeg-user] Trouble selecting a pixel format/colorspace while trying to encode a video using ffmpeg and HW accelerated vaapi or qsv interfaces

2022-12-08 Thread caetano
Output of 'ffmpeg -h filter=vpp_qsv' is bellow


Filter vpp_qsv
  Quick Sync Video VPP.
Inputs:
   #0: default (video)
Outputs:
   #0: default (video)
vpp_qsv AVOptions:
   deinterlace   ..FV... deinterlace mode: 0=off, 1=bob, 
2=advanced (from 0 to 2) (default 0)
 bob 1..FV... Bob deinterlace mode.
 advanced2..FV... Advanced deinterlace mode. 
   denoise   ..FV... denoise level [0, 100] (from 0 to 
100) (default 0)
   detail..FV... enhancement level [0, 100] (from 
0 to 100) (default 0)
   framerate..FV... output framerate (from 0 to 
DBL_MAX) (default 0/1)
   procamp   ..FV... Enable ProcAmp (from 0 to 1) 
(default 0)
   hue ..FV... ProcAmp hue (from -180 to 180) 
(default 0)
   saturation  ..FV... ProcAmp saturation (from 0 to 10) 
(default 1)
   contrast..FV... ProcAmp contrast (from 0 to 10) 
(default 1)
   brightness  ..FV... ProcAmp brightness (from -100 to 
100) (default 0)
   transpose ..FV... set transpose direction (from -1 
to 6) (default -1)
 cclock_hflip0..FV... rotate counter-clockwise with 
horizontal flip
 clock   1..FV... rotate clockwise
 cclock  2..FV... rotate counter-clockwise
 clock_hflip 3..FV... rotate clockwise with horizontal 
flip
 reversal4..FV... rotate by half-turn
 hflip   5..FV... flip horizontally
 vflip   6..FV... flip vertically
   cw ..FV... set the width crop area 
expression (default "iw")
   ch ..FV... set the height crop area 
expression (default "ih")
   cx ..FV... set the x crop area expression 
(default "(in_w-out_w)/2")
   cy ..FV... set the y crop area expression 
(default "(in_h-out_h)/2")
   w  ..FV... Output video width (default "cw")
   width  ..FV... Output video width (default "cw")
   h  ..FV... Output video height (default 
"w*ch/cw")
   height ..FV... Output video height (default 
"w*ch/cw")
   format ..FV... Output pixel format (default 
"same")
   async_depth   ..FV... Internal parallelization depth, 
the higher the value the higher the latency. (from 0 to INT_MAX) (default 0)
   scale_mode..FV... scale mode: 0=auto, 1=low power, 
2=high quality (from 0 to 2) (default 0)


I tried the following command with vpp_qsv filter but pixel format/colorspace 
of the output is the same:


ffmpeg -init_hw_device qsv=hw -filter_hw_device hw -v verbose -f x11grab 
-draw_mouse 0 -framerate 20 -probesize 42M -video_size 1920x1200 
-thread_queue_size 1000 -vcodec rawvideo -i ":0.0" -an -vf 
'hwupload=extra_hw_frames=64,vpp_qsv=format=bgra' -c:v hevc_qsv -preset 
veryslow -global_quality 17 -look_ahead 1 -y /tmp/output.mkv


The ffprobe result for the above command is:


Input #0, matroska,webm, from '/tmp/output.mkv':
  Metadata:
ENCODER : Lavf59.27.100
  Duration: 00:00:04.85, start: 0.00, bitrate: 50 kb/s
  Stream #0:0: Video: hevc (Main), yuvj420p(pc, gbr/unknown/unknown, 
progressive), 1920x1200 [SAR 1:1 DAR 8:5], 20 fps, 20 tbr, 1k tbn
Metadata:
  ENCODER : Lavc59.37.100 hevc_qsv
  DURATION: 00:00:04.85000


On Thu, 8 Dec 2022 at 17:06, Dennis Mungai  wrote:

> Hey there,
>
> I'd recommend using the vpp_qsv filter instead.
>
> Please provide the output of:
>
> ffmpeg -h filter=vpp_qsv
>
> And I'll generate a command line you can use to test and report back.
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

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


Re: [FFmpeg-user] Trouble selecting a pixel format/colorspace while trying to encode a video using ffmpeg and HW accelerated vaapi or qsv interfaces

2022-12-08 Thread Dennis Mungai
On Thu, 8 Dec 2022 at 22:32,  wrote:

> I'm having trouble selecting a pixel format/colorspace while trying to
> encode a video using ffmpeg and HW accelerated vaapi or qsv interfaces. I
> have an i7-1165G7 with integrated graphics and I'm using ffmpeg 5.1.1 with
> ubuntu
>
> I'm able to select the pixel format/colorspace with the SW encoder, for
> instance, if I use the following command:
>
> 
> ffmpeg -f x11grab -draw_mouse 0 -framerate 20 -probesize 42M -video_size
> 1920x1200 -thread_queue_size 1000 -vcodec rawvideo -i ":0.0" -an -c:v hevc
> -preset veryslow -global_quality 17 -look_ahead 1 -y /tmp/output.mkv
> 
>
> I get the correct pixel format and with ffprobe I have the following:
>
> 
> Input #0, matroska,webm, from '/tmp/output.mkv':
>   Metadata:
> ENCODER : Lavf59.27.100
>   Duration: 00:00:02.90, start: 0.00, bitrate: 92 kb/s
>   Stream #0:0: Video: hevc (Rext), gbrp(pc, gbr/unknown/unknown,
> progressive), 1920x1200, 20 fps, 20 tbr, 1k tbn
> Metadata:
>   ENCODER : Lavc59.37.100 libx265
>   DURATION: 00:00:02.9
> 
>
> The video from the above example is correctly encoded and colors are
> exactly what I need them to be.
>
> On the other hand, when I try to use the HW encoder, the pixel format is
> wrong. For instance:
>
> 
> ffmpeg -init_hw_device qsv=hw -filter_hw_device hw -v verbose -f x11grab
> -draw_mouse 0 -framerate 20 -probesize 42M -video_size 1920x1200
> -thread_queue_size 1000 -vcodec rawvideo -i ":0.0" -an -vf
> 'hwupload=extra_hw_frames=64,scale_qsv=format=bgra' -c:v hevc_qsv -preset
> veryslow -global_quality 17 -look_ahead 1 -y /tmp/output.mkv
> 
>
> ffprobe generates:
>
> 
> Input #0, matroska,webm, from '/tmp/output.mkv':
>   Metadata:
> ENCODER : Lavf59.27.100
>   Duration: 00:00:04.40, start: 0.00, bitrate: 55 kb/s
>   Stream #0:0: Video: hevc (Main), yuvj420p(pc, gbr/unknown/unknown,
> progressive), 1920x1200 [SAR 1:1 DAR 8:5], 20 fps, 20 tbr, 1k tbn
> Metadata:
>   ENCODER : Lavc59.37.100 hevc_qsv
>   DURATION: 00:00:04.4
> 
>
> As you can see, in the first example, libx265 SW encoder based, the output
> is generated with the "gbrp" colorspace while in the second example,
> hevc_qsv HW encoder based, the output is generated with the "yuvj420p"
> pixel format.
>
> QUESTION: How can I properly control the pixel format/colorspace of the
> generated output using the HW based encoders such as QSV or VAAPI with
> my i7-1165G7 integrated graphics card ? I would like a format that is 24 or
> 32bits instead of the 12bits I'm getting
>
>
Hey there,

I'd recommend using the vpp_qsv filter instead.

Please provide the output of:

ffmpeg -h filter=vpp_qsv

And I'll generate a command line you can use to test and report back.
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

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


[FFmpeg-user] Trouble selecting a pixel format/colorspace while trying to encode a video using ffmpeg and HW accelerated vaapi or qsv interfaces

2022-12-08 Thread caetano
I'm having trouble selecting a pixel format/colorspace while trying to encode a 
video using ffmpeg and HW accelerated vaapi or qsv interfaces. I have an 
i7-1165G7 with integrated graphics and I'm using ffmpeg 5.1.1 with ubuntu

I'm able to select the pixel format/colorspace with the SW encoder, for 
instance, if I use the following command:


ffmpeg -f x11grab -draw_mouse 0 -framerate 20 -probesize 42M -video_size 
1920x1200 -thread_queue_size 1000 -vcodec rawvideo -i ":0.0" -an -c:v hevc 
-preset veryslow -global_quality 17 -look_ahead 1 -y /tmp/output.mkv


I get the correct pixel format and with ffprobe I have the following:


Input #0, matroska,webm, from '/tmp/output.mkv':
  Metadata:
    ENCODER         : Lavf59.27.100
  Duration: 00:00:02.90, start: 0.00, bitrate: 92 kb/s
  Stream #0:0: Video: hevc (Rext), gbrp(pc, gbr/unknown/unknown, progressive), 
1920x1200, 20 fps, 20 tbr, 1k tbn
    Metadata:
      ENCODER         : Lavc59.37.100 libx265
      DURATION        : 00:00:02.9


The video from the above example is correctly encoded and colors are exactly 
what I need them to be.

On the other hand, when I try to use the HW encoder, the pixel format is wrong. 
For instance:


ffmpeg -init_hw_device qsv=hw -filter_hw_device hw -v verbose -f x11grab 
-draw_mouse 0 -framerate 20 -probesize 42M -video_size 1920x1200 
-thread_queue_size 1000 -vcodec rawvideo -i ":0.0" -an -vf 
'hwupload=extra_hw_frames=64,scale_qsv=format=bgra' -c:v hevc_qsv -preset 
veryslow -global_quality 17 -look_ahead 1 -y /tmp/output.mkv


ffprobe generates:


Input #0, matroska,webm, from '/tmp/output.mkv':
  Metadata:
    ENCODER         : Lavf59.27.100
  Duration: 00:00:04.40, start: 0.00, bitrate: 55 kb/s
  Stream #0:0: Video: hevc (Main), yuvj420p(pc, gbr/unknown/unknown, 
progressive), 1920x1200 [SAR 1:1 DAR 8:5], 20 fps, 20 tbr, 1k tbn
    Metadata:
      ENCODER         : Lavc59.37.100 hevc_qsv
      DURATION        : 00:00:04.4


As you can see, in the first example, libx265 SW encoder based, the output is 
generated with the "gbrp" colorspace while in the second example, hevc_qsv HW 
encoder based, the output is generated with the "yuvj420p" pixel format.

QUESTION: How can I properly control the pixel format/colorspace of the 
generated output using the HW based encoders such as QSV or VAAPI with my 
i7-1165G7 integrated graphics card ? I would like a format that is 24 or 32bits 
instead of the 12bits I'm getting
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

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