https://raw.githubusercontent.com/FFmpeg/FFmpeg/master/Changelog
For software developers: <br><br>Next (v. 2.3) FFMPEG will support DXVA2 decoding to accelerate the video transcoding!!!<br><br>
What do you think, Will it increase the transcoding speed?
+ Reply to Thread
Results 1 to 7 of 7
-
-
Using jb-alvarados media-autobuild_suite I compiled ffmpeg with dxva2 enabled:
Code:#define HAVE_DXVA2API_COBJ 1 #define HAVE_DXVA2_LIB 1 #define CONFIG_DXVA2 1 #define CONFIG_HWACCELS 1 #define CONFIG_H264_DXVA2_HWACCEL 1 #define CONFIG_MPEG2_DXVA2_HWACCEL 1 #define CONFIG_VC1_DXVA2_HWACCEL 1 #define CONFIG_WMV3_DXVA2_HWACCEL 1
But when I then use:
Code:ffplay.exe -hwaccel dxva2 "Path to file"
Failed to set value 'dxva2' for option 'hwaccel': Option not found
-> Can anyone tell me how I can use dxva2 decoding with ffmpeg&ffplay?
Cu Selur -
-> ffplay doesn't support DXVA2 atm.
2pass 1st pass + hwaccel auto:
Code:ffmpeg -y -loglevel fatal -hwaccel auto -r 24000/1001 -i "F:\test.mkv" -an -sn -threads 8 -vsync 0 -r 24000/1001 -pix_fmt yuv420p -f rawvideo - | x264 --pass 1 --bitrate 1500 --profile high --level 4.1 --direct auto --qcomp 0.5 --no-mbtree --weightp 1 --aq-mode 0 --non-deterministic --stats "H:\Temp\test_17_03_24_7810_01.stats" --input-csp i420 --fps 24000/1001 --input-res 1280x534 --output NUL -
raw [info]: 1280x534p 0:0 @ 24000/1001 fps (cfr)
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX AVX2 FMA3 LZCNT BMI2
x264 [info]: profile Main, level 4.1
x264 [info]: frame I:2219 Avg QP:20.75 size: 35900
x264 [info]: frame P:88983 Avg QP:22.69 size: 11096
x264 [info]: frame B:77810 Avg QP:23.83 size: 3301
x264 [info]: consecutive B-frames: 26.4% 32.4% 12.6% 28.6%
x264 [info]: mb I I16..4: 58.9% 0.0% 41.1%
x264 [info]: mb P I16..4: 17.0% 0.0% 0.0% P16..4: 41.9% 0.0% 0.0% 0.0% 0.0% skip:41.1%
x264 [info]: mb B I16..4: 0.7% 0.0% 0.0% B16..8: 17.5% 0.0% 0.0% direct: 7.7% skip:74.1% L0:28.9% L1:46.7% BI:24.3%
x264 [info]: final ratefactor: 22.06
x264 [info]: direct mvs spatial:95.1% temporal:4.9%
x264 [info]: coded y,uvDC,uvAC intra: 28.9% 34.1% 9.0% inter: 12.2% 9.0% 0.8%
x264 [info]: i16 v,h,dc,p: 43% 29% 17% 11%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 22% 23% 14% 7% 7% 7% 7% 6% 7%
x264 [info]: i8c dc,h,v,p: 61% 18% 18% 2%
x264 [info]: Weighted P-Frames: Y:6.3% UV:3.3%
x264 [info]: kb/s:1502.40
encoded 169012 frames, 370.36 fps, 1502.40 kb/s
finished after 00:07:36.514
Code:ffmpeg -y -loglevel fatal -hwaccel auto -r 24000/1001 -i "F:\test.mkv" -an -sn -threads 8 -vsync 0 -r 24000/1001 -pix_fmt yuv420p -f rawvideo - | x264 --pass 2 --bitrate 1500 --profile high --level 4.1 --direct auto --qcomp 0.5 --no-mbtree --partitions i4x4,p8x8,b8x8 --no-fast-pskip --subme 5 --trellis 0 --weightp 1 --aq-mode 0 --vbv-maxrate 62500 --vbv-bufsize 78125 --non-deterministic --colormatrix bt709 --stats "H:\Temp\test_17_03_24_7810_01.stats" --input-csp i420 --fps 24000/1001 --input-res 1280x534 --output "H:\Temp\test_17_03_24_7810_02.264" -
raw [info]: 1280x534p 0:0 @ 24000/1001 fps (cfr)
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX AVX2 FMA3 LZCNT BMI2
x264 [info]: profile High, level 4.1
x264 [info]: frame I:2219 Avg QP:20.07 size: 38839
x264 [info]: frame P:88983 Avg QP:22.37 size: 10825
x264 [info]: frame B:77810 Avg QP:23.00 size: 3492
x264 [info]: consecutive B-frames: 26.4% 32.4% 12.6% 28.6%
x264 [info]: mb I I16..4: 22.2% 55.2% 22.6%
x264 [info]: mb P I16..4: 19.3% 0.0% 4.4% P16..4: 35.1% 13.3% 4.6% 0.0% 0.0% skip:23.3%
x264 [info]: mb B I16..4: 0.6% 0.0% 0.3% B16..8: 24.6% 6.2% 0.6% direct: 5.5% skip:62.2% L0:33.6% L1:53.6% BI:12.7%
x264 [info]: 8x8 transform intra:5.1% inter:40.3%
x264 [info]: direct mvs spatial:86.7% temporal:13.3%
x264 [info]: coded y,uvDC,uvAC intra: 26.2% 29.4% 8.5% inter: 9.6% 7.9% 0.7%
x264 [info]: i16 v,h,dc,p: 47% 26% 13% 14%
x264 [info]: i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 26% 23% 21% 5% 5% 5% 5% 5% 6%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 24% 21% 16% 6% 7% 7% 7% 6% 5%
x264 [info]: i8c dc,h,v,p: 64% 16% 17% 2%
x264 [info]: Weighted P-Frames: Y:6.6% UV:3.3%
x264 [info]: ref P L0: 72.7% 17.1% 10.3%
x264 [info]: ref B L0: 84.2% 13.7% 2.0%
x264 [info]: ref B L1: 94.8% 5.2%
x264 [info]: kb/s:1499.37
encoded 169012 frames, 163.86 fps, 1499.37 kb/s
finished after 00:17:15.849
Created H:\Temp\test_17_03_24_7810_02.264 (1259.97 MB)
Code:ffmpeg -y -loglevel fatal -r 24000/1001 -i "F:\test.mkv" -an -sn -threads 8 -vsync 0 -r 24000/1001 -pix_fmt yuv420p -f rawvideo - | x264 --pass 1 --bitrate 1500 --profile high --level 4.1 --direct auto --qcomp 0.5 --no-mbtree --weightp 1 --aq-mode 0 --non-deterministic --stats "H:\Temp\test_17_13_26_7710_01.stats" --input-csp i420 --fps 24000/1001 --input-res 1280x534 --output NUL -
raw [info]: 1280x534p 0:0 @ 24000/1001 fps (cfr)
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX AVX2 FMA3 LZCNT BMI2
x264 [info]: profile Main, level 4.1
x264 [info]: frame I:2219 Avg QP:20.75 size: 35888
x264 [info]: frame P:88985 Avg QP:22.70 size: 11098
x264 [info]: frame B:77808 Avg QP:23.83 size: 3298
x264 [info]: consecutive B-frames: 26.4% 32.4% 12.6% 28.6%
x264 [info]: mb I I16..4: 58.9% 0.0% 41.1%
x264 [info]: mb P I16..4: 17.1% 0.0% 0.0% P16..4: 41.8% 0.0% 0.0% 0.0% 0.0% skip:41.1%
x264 [info]: mb B I16..4: 0.7% 0.0% 0.0% B16..8: 17.5% 0.0% 0.0% direct: 7.7% skip:74.2% L0:28.9% L1:46.7% BI:24.3%
x264 [info]: final ratefactor: 22.07
x264 [info]: direct mvs spatial:95.1% temporal:4.9%
x264 [info]: coded y,uvDC,uvAC intra: 28.9% 34.1% 9.0% inter: 12.2% 9.0% 0.8%
x264 [info]: i16 v,h,dc,p: 43% 29% 17% 11%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 22% 23% 14% 7% 7% 7% 7% 6% 7%
x264 [info]: i8c dc,h,v,p: 61% 18% 18% 2%
x264 [info]: Weighted P-Frames: Y:6.3% UV:3.3%
x264 [info]: kb/s:1502.37
encoded 169012 frames, 356.28 fps, 1502.37 kb/s
finished after 00:07:54.442
Code:ffmpeg -y -loglevel fatal -r 24000/1001 -i "F:\test.mkv" -an -sn -threads 8 -vsync 0 -r 24000/1001 -pix_fmt yuv420p -f rawvideo - | x264 --pass 2 --bitrate 1500 --profile high --level 4.1 --direct auto --qcomp 0.5 --no-mbtree --partitions i4x4,p8x8,b8x8 --no-fast-pskip --subme 5 --trellis 0 --weightp 1 --aq-mode 0 --vbv-maxrate 62500 --vbv-bufsize 78125 --non-deterministic --colormatrix bt709 --stats "H:\Temp\test_17_13_26_7710_01.stats" --input-csp i420 --fps 24000/1001 --input-res 1280x534 --output "H:\Temp\test_17_13_26_7710_02.264" -
raw [info]: 1280x534p 0:0 @ 24000/1001 fps (cfr)
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX AVX2 FMA3 LZCNT BMI2
x264 [info]: profile High, level 4.1
x264 [info]: frame I:2219 Avg QP:20.07 size: 38848
x264 [info]: frame P:88985 Avg QP:22.37 size: 10823
x264 [info]: frame B:77808 Avg QP:22.99 size: 3495
x264 [info]: consecutive B-frames: 26.4% 32.4% 12.6% 28.6%
x264 [info]: mb I I16..4: 22.2% 55.2% 22.6%
x264 [info]: mb P I16..4: 19.3% 0.0% 4.4% P16..4: 35.1% 13.3% 4.6% 0.0% 0.0% skip:23.3%
x264 [info]: mb B I16..4: 0.6% 0.0% 0.3% B16..8: 24.6% 6.2% 0.6% direct: 5.6% skip:62.1% L0:33.6% L1:53.6% BI:12.7%
x264 [info]: 8x8 transform intra:5.1% inter:40.3%
x264 [info]: direct mvs spatial:86.7% temporal:13.3%
x264 [info]: coded y,uvDC,uvAC intra: 26.2% 29.4% 8.5% inter: 9.6% 7.9% 0.7%
x264 [info]: i16 v,h,dc,p: 47% 26% 13% 14%
x264 [info]: i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 26% 23% 21% 5% 5% 5% 5% 5% 6%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 24% 21% 16% 6% 7% 7% 7% 6% 5%
x264 [info]: i8c dc,h,v,p: 64% 16% 17% 2%
x264 [info]: Weighted P-Frames: Y:6.6% UV:3.3%
x264 [info]: ref P L0: 72.7% 17.1% 10.3%
x264 [info]: ref B L0: 84.2% 13.7% 2.0%
x264 [info]: ref B L1: 94.8% 5.2%
x264 [info]: kb/s:1499.38
encoded 169012 frames, 145.62 fps, 1499.38 kb/s
finished after 00:19:25.073
Created H:\Temp\test_17_13_26_7710_02.264 (1259.98 MB)
2pass 2nd pass: 163.86 fps vs. 145.62 fps (+ 18.26 fps, hoped for more after comparing looking at the results of the 1st passes, but I'm quite happy with the result)
Conclusion so far: It helps
(side note: used my i7-4770k with a NVIDIA 600 ti)Last edited by Selur; 26th Jun 2014 at 15:22.
-
Selur, can you help me?
I'm new in video processing. I'm developing a simple app, which decode video using hw acceleration.
I have to use ffmpeg dxva2 api, but i can't find any simple and working example of code(C++). I tried to spy in ffmpeg, mpc-hc sources, but it is too complicated for me.
How to use ffmpeg dxva2 api to decode video? Can you give me an simple example?