вт, 12 нояб. 2024 г., 00:00 Terje J. Hanssen <[email protected]>:
Den 26.10.2024 18:31, skrev Terje J. Hanssen:
Den 26.10.2024 17:26, skrev Terje J. Hanssen:
Den 26.10.2024 17:10, skrev Andrew Randrianasulu:
сб, 26 окт. 2024 г., 17:39 Terje J. Hanssen <[email protected]>:
Den 26.10.2024 02:12, skrev Andrew Randrianasulu:
сб, 26 окт. 2024 г., 03:06 Terje J. Hanssen via Cin < [email protected]>:
An overview over the system FFmpeg 7.1 supported QSV pixel formats and profiles:
ffmpeg -hide_banner -encoders | grep qsv V..... av1_qsv AV1 (Intel Quick Sync Video acceleration) (codec av1) V..... h264_qsv H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (Intel Quick Sync Video acceleration) (codec h264) V..... hevc_qsv HEVC (Intel Quick Sync Video acceleration) (codec hevc) V..... mjpeg_qsv MJPEG (Intel Quick Sync Video acceleration) (codec mjpeg) V..... mpeg2_qsv MPEG-2 video (Intel Quick Sync Video acceleration) (codec mpeg2video) V..... vp9_qsv VP9 video (Intel Quick Sync Video acceleration) (codec vp9)
ffmpeg -hide_banner -h encoder=av1_qsv | egrep 'Supported|profile|main|high|professional' Supported hardware devices: qsv qsv qsv Supported pixel formats: nv12 p010le qsv -profile <int> E..V....... (from 0 to INT_MAX) (default unknown) main 1 E..V.......
ffmpeg -hide_banner -h encoder=hevc_qsv | egrep 'Supported|profile|main|high|professional' Supported hardware devices: qsv qsv qsv Supported pixel formats: nv12 p010le p012le yuyv422 y210le qsv bgra x2rgb10le vuyx xv30le -profile <int> E..V....... (from 0 to INT_MAX) (default unknown) main 1 E..V....... main10 2 E..V....... mainsp 3 E..V....... -tier <int> E..V....... Set the encoding tier (only level >= 4 can support high tier) (from 0 to 256) (default high) main 0 E..V....... high 256 E..V.......
ffmpeg -hide_banner -h encoder=h264_qsv | egrep 'Supported|profile|main|high|professional' Supported hardware devices: qsv qsv qsv Supported pixel formats: nv12 qsv -profile <int> E..V....... (from 0 to INT_MAX) (default unknown) main 77 E..V....... high 100 E..V.......
from this we can conclude av1/hevc should have 10bit option ...
probably writing down numerical values for profiles (high, main...) for each codec is also good idea.
A reference and overview table for QSV capabilties for each iGPU and dGPU generation is here
https://en.wikipedia.org/wiki/Intel_Quick_Sync_Video#Hardware_decoding_and_e...
And finally, after much trying and failing, I was able to prove that true 10bit 422 color depth hevc_qsv encoding is possible with my system ffmpeg 7.1 . While pixel format p010le results in "just" 10bit yuv420p, the clue is to to use either (trying this for av1_qsv, auto- switch to 8bit nv12):
-pix_fmt y210le or -v format=yuv422p010le
typo, should be
-vf format=yuv422p10le
Code example:
ffmpeg -hide_banner -hwaccel_output_format qsv -i cfhd01.mkv -c:v hevc_qsv -pix_fmt y210le cfhd01_hevc_qsv_pxfmt_y210le.mp4
Input file:
ffprobe -hide_banner cfhd01.mkv Input #0, matroska,webm, from 'cfhd01.mkv': Metadata: ENCODER : Lavf61.1.100 Duration: 00:01:11.24, start: 0.000000, bitrate: 393480 kb/s Stream #0:0(eng): Video: cfhd (CFHD / 0x44484643), yuv422p10le(tv, bt709, top coded first (swapped)), 1920x1080, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 1k tbn (default) Metadata: HANDLER_NAME : Apple Video Media Handler VENDOR_ID : appl ENCODER : Lavc61.3.100 cfhd DURATION : 00:01:11.240000000
Output file:
ffprobe -hide_banner cfhd01_hevc_qsv_pxfmt_y210le.mp4 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'cfhd01_hevc_qsv_pxfmt_y210le.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 encoder : Lavf61.7.100 Duration: 00:01:11.24, start: 0.000000, bitrate: 31770 kb/s Stream #0:0[0x1](eng): Video: hevc (Rext) (hev1 / 0x31766568), yuv422p10le(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 31767 kb/s, 25 fps, 25 tbr, 12800 tbn (default) Metadata: handler_name : Apple Video Media Handler vendor_id : [0][0][0][0] encoder : Lavc61.19.100 hevc_qsv
Good to know.
Hopefully if we on the right track with "just" 10bit yuv420 encoding we will find way to stuff more complex cases in there too ....
Does it work with vaapi encoder (system ffmpeg as cli application) too?
I am testing similar now with vaapi and will report on that thread soon. The above i/o files and simple code line are video only, to avoid confusing from 16ch audio in the prores_hq.mov
Regarding ffmpeg quality flags or parameters, I wonder if is an idea to standardized on "-global_quality" at least for qsv and VAAPI if possible? Documentation is limited, though it looks like the range may be: 1 (best) - 51; 18 and 25 and even 50 and 90 are used by ffmpeg examples as follows:
as long as resulting profiles still run on AMD's (mesa3d) vaapi implementation and older Intels ... feel free to modify them and post them here with note to Phyllis so she hopefully will re-test them on her hardware and if no error arise add to our main git
https://nelsonslog.wordpress.com/2022/08/22/ffmpeg-and-hevc_qsv-intel-quick-... https://kimathir.wordpress.com/2018/05/07/intel-qsv-encoding-coffee-lake/
https://superuser.com/questions/1830920/constructing-encoding-statements-usi... https://trac.ffmpeg.org/wiki/Hardware/QuickSync#FullExamples https://trac.ffmpeg.org/wiki/Hardware/VAAPI#FullExamples