rigaya/QSVEnc

Is there Limitation in --avsw for decoding certain codecs example VC-1 ?

Closed this issue · 5 comments

I wanted to ask if there are any specific limitations when using --avsw compared to --avs for decoding, particularly with VC-1 video sources.

For example, in one of my tests:

Setup:

CPU: AMD Ryzen 9 5950X 16-Core Processor [4.99GHz] (16C/32T)
GPU: Intel Arc A770 Graphics (512EU) 300-2400MHz (32.0.101.5768)
Video Source: VC-1 - 1920x1080

Results:

With --avs: Encoded 15,456 frames at 435.87 fps, 5616.79 kbps, 431.64 MB.
With --avsw: Encoded 15,456 frames at 145.93 fps, 5616.78 kbps, 431.64 MB.

As you can see, there's a significant difference in performance.
Are there any inherent limitations or reasons why --avsw might be slower or less efficient than --avs in such scenarios?

Thank you for your time and for all the great work you do.

There shall be no specific limitations for --avsw, and I can't come up of a reason that causes performance difference, as long as libavocdec VC-1 sw decoder is used in both --avsw and --avs.

I've tested 1080p VC-1 file from below.
https://samplemedia.linaro.org/VC1/big_buck_bunny_1080p_VC1_WMA3_25fps_8600K.WMV

The avs files is below.

v = LWLibavVideoSource("big_buck_bunny_1080p_VC1_WMA3_25fps_8600K.WMV")
a = LWLibavAudioSource("big_buck_bunny_1080p_VC1_WMA3_25fps_8600K.WMV")
audiodub(v,a)

Setup

QSVEncC (x64) 7.69 (r3429) by rigaya, Aug 20 2024 18:57:24 (VC 1941/Win)
OS Windows 11 x64 (22631) [UTF-8]
CPU Info 12th Gen Intel Core i9-12900K [5.12GHz] (8P+8E,16C/24T)
GPU Info Intel Arc A380 Graphics (128EU) 300-2450MHz (32.0.101.5768)
Media SDK QuickSyncVideo (hardware encoder) FF, 1st GPU(d), API v2.11

Result

avsw -> 256.98 fps
x64\QSVEncC64.exe --avsw -i big_buck_bunny_1080p_VC1_WMA3_25fps_8600K.WMV -o test.mp4

avs -> 255.23 fps
x64\QSVEncC64.exe --avs -i big_buck_bunny_1080p_VC1_WMA3_25fps_8600K.WMV.avs -o test.mp4


There might be a case that hw decode is used internally in your avs input plugin. Although I'm not being able to use hw decode in avs, there are input plugins which support hw decode.

For example, it seems like VC-1 hw decode by cuvid (nvdec) is faster.

avsw vc1_cuvid -> 352.05 fps
x64\QSVEncC64.exe --avsw vc1_cuvid -i big_buck_bunny_1080p_VC1_WMA3_25fps_8600K.WMV -o test.mp4

NVEnc avhw -> 467.12 fps
x64\NVEncC64.exe --avhw -i big_buck_bunny_1080p_VC1_WMA3_25fps_8600K.WMV -o test.mp4

Thank you @rigaya

I'll check it with the file you used to see if there is any difference.
I will report when the test is completed; it might take a while.

@rigaya

I did run the tests a and compared the two filters in AVS.
LWLibavVideoSource = 133.21 fps
DirectshowSource =449.80 fps

Thank you.

I will close this, as my question has been answered.
Thank you again @rigaya

There is no need to reopen this as it is just an add-on for anyone who finds this:

Using --avsw vc1_qsv dramatically improves the encoding speed due to the hardware-accelerated decoding process:

Without vc1_qsv: Encoding is slower, with frame rates ranging from 145.44 fps (32-bit) to 163.41 fps (64-bit).

With vc1_qsv: Encoding speeds are almost doubled, with frame rates of 276.17 fps (32-bit) to 277.67 fps (64-bit).