View Full Version : How to use ffmpeg/ffplay dxva2?
Selur
26th June 2014, 10:08
Using jb-alvarados media-autobuild_suite (https://github.com/jb-alvarado/media-autobuild_suite) I compiled ffmpeg with dxva2 enabled:
#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
see: config.h (http://pastebin.com/W3hr6THx)
But when I then use:
ffplay.exe -hwaccel dxva2 "Path to file"
I get:
Failed to set value 'dxva2' for option 'hwaccel': Option not found
which should work (https://ffmpeg.org/ffmpeg.html#Advanced-Video-Options) unless I'm missing something obvious.
-> Can anyone tell me how I can use dxva2 decoding with ffmpeg&ffplay?
Cu Selur
nevcairiel
26th June 2014, 12:33
The hwaccel option is only implemented for ffmpeg, not ffplay, IIRC anyway.
I implemented DXVA for the ffmpeg CLI and I certainly only ever tested with ffmpeg. Note that it's considered more of a tool to test the DXVA functions in the decoding libraries (so it can be tested without an external player) than an actual useful user feature. ;)
Selur
26th June 2014, 12:51
Okay. Is it enought to call '-hwaccel dxva2' with ffmpeg or are there some other options needed additionally to use dxva2 ?
nevcairiel
26th June 2014, 13:34
That should be enough. Note that ffmpeg's CLI is very position dependent, so it matters where the option is placed on the command line.
ie this works:
ffmpeg.exe -hwaccel dxva2 -i <file> ...
but placing -hwaccel after the input command does not.
Not sure how well it works on various GPUs anyway, it was mostly tested on NVIDIA only.
Its usually a good idea to turn off multi-threaded decoding when using DXVA2 (ie -threads 1). It doesn't actually add any performance (in fact, may cost some), and causes weird problems occasionally.
So for my final recommendation:
ffmpeg.exe -hwaccel dxva2 -threads 1 -i <file> ....
(You can set a second threads option later on the line to enable threading for any potential encoders, while keeping it off for the decoder)
Selur
26th June 2014, 17:03
2pass 1st pass + hwaccel auto:
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
2pass 2nd pass + hwaccel auto:
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)
2pass 1st pass + no hwaccel:
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
2pass 2nd pass + no hwaccel:
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 1st pass: 370.36 fps vs. 356.28 fps (+ 14.04fps, didn't expect that since the cpu normally isn't fully stressed during 1st pass)
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 :)
Selur
26th June 2014, 18:25
removed to avoid confusion
nevcairiel
26th June 2014, 20:14
"-hwaccel_device 0" is the default device (ie. your primary screen), the same as not providing the option, are you sure you switched the device?
The 4600 should have a significantly faster decoder than the 660 Ti (like, 400 fps vs 120 fps on 1080p)
Selur
26th June 2014, 21:03
You are right something is off. :(
when calling:
ffmpeg -y -loglevel fatal -hwaccel_device 0 -hwaccel auto -r 24000/1001 -i "F:\test.mkv" -an -sn -threads 8 -vsync 0 -r 24000/1001 -pix_fmt yuv420p -f rawvideo NUL
CPU~3%/NVIDIA VPU at 99%
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 NUL
CPU~3%/NVIDIA VPU at 99%
ffmpeg -y -loglevel fatal -hwaccel_device 2 -hwaccel auto -r 24000/1001 -i "F:\test.mkv" -an -sn -threads 8 -vsync 0 -r 24000/1001 -pix_fmt yuv420p -f rawvideo NUL
CPU~99%/NVIDIA VPU idle at 0% <- okay, I only got 2 gpus so this is software decoding
ffmpeg -y -loglevel fatal -hwaccel_device 1 -hwaccel auto -r 24000/1001 -i "F:\test.mkv" -an -sn -threads 8 -vsync 0 -r 24000/1001 -pix_fmt yuv420p -f rawvideo NUL
CPU~13%/NVIDIA VPU idle at 0%
now comes the problem, removing '-loglevel fatal'
ffmpeg -y -hwaccel_device 1 -hwaccel auto -r 24000/1001 -i "F:\test.mkv" -an -sn -threads 8 -vsync 0 -r 24000/1001 -pix_fmt yuv420p -f rawvideo NUL
I get lots of errors:
Using HWAccel device 1
[h264 @ 0000000005c72360] Failed to execute: 0xc0262111
[h264 @ 0000000005c72360] hardware accelerator failed to decode picture
Input stream #0:0 frame changed from size:1280x534 fmt:yuv420p to size:1280x534
fmt:nv12
[h264 @ 0000000005cf0ea0] Failed to execute: 0xc0262111
[h264 @ 0000000005cf0ea0] hardware accelerator failed to decode picture
[h264 @ 0000000005c72360] Failed to execute: 0xc0262111
[h264 @ 0000000005c72360] hardware accelerator failed to decode picture
[h264 @ 0000000005cf0ea0] Failed to execute: 0xc0262111
[h264 @ 0000000005cf0ea0] hardware accelerator failed to decode picture
[h264 @ 0000000005c72360] Failed to execute: 0xc0262111
[h264 @ 0000000005c72360] hardware accelerator failed to decode picture
[h264 @ 0000000005cf0ea0] Failed to execute: 0xc0262111
[h264 @ 0000000005cf0ea0] hardware accelerator failed to decode picture
[h264 @ 0000000005c72360] Failed to execute: 0xc0262111
[h264 @ 0000000005c72360] hardware accelerator failed to decode picture
[h264 @ 0000000005cf0a00] Failed to execute: 0xc0262111
[h264 @ 0000000005cf0a00] hardware accelerator failed to decode picture
[h264 @ 0000000005d2e160] Failed to execute: 0xc0262111
[h264 @ 0000000005d2e160] hardware accelerator failed to decode picture
-> seems like something is off -> restarting my system, may be me running Virtual Box and Teamviewer a few minutes ago did something funny
Selur
26th June 2014, 21:18
Did a restart and the results are the same.
(btw. I just played the file with MPC-HC and set QuickSync as decoder and cpu usage is <10%.)
-> seems like the benchmarks from before are off and my Intel HD 4600 doesn't work with ffmpeg
nevcairiel
26th June 2014, 21:46
I told you, add -threads 1, that will stop these errors. :)
Whoever decided that allowing multi-threading with hwaccel is a good idea needs some attitude adjustment. :p
Selur
26th June 2014, 21:48
will try :)
Selur
26th June 2014, 22:48
ffmpeg -y -hwaccel_device 1 -hwaccel auto -threads 1 -r 24000/1001 -i "F:\test.mkv" -an -sn -threads 8 -vsync 0 -r 24000/1001 -pix_fmt yuv420p -f rawvideo NUL
does remove the errors, but decoding is stuck at 79fps since the cpu is used with one thread.
Doesn't look like it is really using the Intel HD 4600 at all.
Made two screenshots one with device 1 and one with device 2, see: http://www.mediahump.com/gallery/4040/
Funny thing is on my laptop (i7-4702MQ+ NVIDIA GTX 765M) a similar thing happens, but this time ffmpeg only uses the Intel HD 4600
device 1 produces ~154fps <- this is the intel hd 4600, checked with GPU-Z (nvidia vpu is idling)
device 0 produces ~ 66fps (<- one cpu code decoding, nvidia vpu and the intel hd 4600 are idling)
nevcairiel
26th June 2014, 22:52
Does the logging say why hwaccel is not used? your screenshots seem to not be working.
If you use -hwaccel dxva2 (instead of "auto"), it'll actually print any hwaccel problems as actual errors, and not just info messages
Also, didnt hwaccel_device 1 actually work before just fine? You said it got you the errors in the first place o.O
PS:
Laptops are weird, the hwaccel_device refers to a screen index, but you only have one screen, so you can't swap GPUs like that easily.
On Windows it of course requires that both your GPUs actually have a connected screen.
Selur
26th June 2014, 23:00
Yeah, it's strange I'm pretty sure that both devices worked fine at the beginning.
Links work fine here:
http://www.mediahump.com/image/257683/
and
http://www.mediahump.com/image/257682/
I also temporarily uploaded them to:
www.selur.info/device_0.png
www.selur.info/device_1.png
using:
G:\Hybrid>ffmpeg -y -hwaccel_device 1 -hwaccel dxva2 -threads 1 -r 24000/1001 -i "F:\test.mkv" -an -sn -threads 8 -vsync 0 -r 24000/1001 -pix_fmt yuv420p -f rawvideo NUL 2> outpu.txt
gives me:
ffmpeg version git-2014-06-26-11ba0c8 Copyright (c) 2000-2014 the FFmpeg developers
built on Jun 26 2014 13:41:01 with gcc 4.9.0 (Rev4, Built by MSYS2 project)
configuration: --arch=x86_64 --disable-debug --disable-shared --disable-doc --enable-gpl --enable-version3 --enable-runtime-cpudetect --enable-avfilter --enable-bzlib --enable-zlib --enable-librtmp --enable-gnutls --enable-avisynth --enable-frei0r --enable-filter=frei0r --enable-libbluray --enable-libcaca --enable-libopenjpeg --enable-fontconfig --enable-libfreetype --enable-libass --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-libschroedinger --enable-libsoxr --enable-libtwolame --enable-libutvideo --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvo-aacenc --enable-openal --enable-libopus --enable-libvidstab --enable-libvpx --enable-libwavpack --enable-libxavs --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzvbi
libavutil 52. 90.101 / 52. 90.101
libavcodec 55. 68.100 / 55. 68.100
libavformat 55. 44.100 / 55. 44.100
libavdevice 55. 13.101 / 55. 13.101
libavfilter 4. 9.100 / 4. 9.100
libswscale 2. 6.100 / 2. 6.100
libswresample 0. 19.100 / 0. 19.100
libpostproc 52. 3.100 / 52. 3.100
[matroska,webm @ 00000000003d8f40] Could not find codec parameters for stream 2 (Subtitle: hdmv_pgs_subtitle): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[matroska,webm @ 00000000003d8f40] Could not find codec parameters for stream 3 (Subtitle: hdmv_pgs_subtitle): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[matroska,webm @ 00000000003d8f40] Could not find codec parameters for stream 4 (Subtitle: hdmv_pgs_subtitle): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, matroska,webm, from 'F:\test.mkv':
Metadata:
encoder : libebml v1.3.0 + libmatroska v1.4.1
creation_time : 2014-05-09 00:22:11
Duration: 01:57:29.22, start: 0.000000, bitrate: 6940 kb/s
Stream #0:0(eng): Video: h264 (High), yuv420p, 1280x534, SAR 1:1 DAR 640:267, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
Stream #0:1(eng): Audio: dts (DTS), 48000 Hz, 5.1(side), fltp, 1536 kb/s (default)
Stream #0:2(eng): Subtitle: hdmv_pgs_subtitle (default)
Stream #0:3(chi): Subtitle: hdmv_pgs_subtitle
Stream #0:4(chi): Subtitle: hdmv_pgs_subtitle
[rawvideo @ 0000000005dd50c0] Using AVStream.codec.time_base as a timebase hint to the muxer is deprecated. Set AVStream.time_base instead.
Output #0, rawvideo, to 'NUL':
Metadata:
encoder : Lavf55.44.100
Stream #0:0(eng): Video: rawvideo (I420 / 0x30323449), yuv420p, 1280x534 [SAR 1:1 DAR 640:267], q=2-31, 200 kb/s, 23.98 fps, 23.98 tbn, 23.98 tbc (default)
Metadata:
encoder : Lavc55.68.100 rawvideo
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> rawvideo (native))
Press [q] to stop, [?] for help
Using HWAccel device 1
Input stream #0:0 frame changed from size:1280x534 fmt:yuv420p to size:1280x534 fmt:nv12
frame= 34 fps=0.0 q=0.0 size= 34042kB time=00:00:01.41 bitrate=196657.1kbits/s
frame= 75 fps= 74 q=0.0 size= 75094kB time=00:00:03.12 bitrate=196657.1kbits/s
frame= 116 fps= 76 q=0.0 size= 116145kB time=00:00:04.83 bitrate=196657.1kbits/s
frame= 156 fps= 77 q=0.0 size= 156195kB time=00:00:06.50 bitrate=196657.1kbits/s
frame= 196 fps= 78 q=0.0 size= 196245kB time=00:00:08.17 bitrate=196657.1kbits/s
frame= 237 fps= 78 q=0.0 size= 237296kB time=00:00:09.88 bitrate=196657.1kbits/s
frame= 277 fps= 78 q=0.0 size= 277346kB time=00:00:11.55 bitrate=196657.1kbits/s
frame= 306 fps= 78 q=0.0 Lsize= 306382kB time=00:00:12.76 bitrate=196657.1kbits/s
video:306382kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000%
Received signal 2: terminating.
with device 0 gives me:
ffmpeg version git-2014-06-26-11ba0c8 Copyright (c) 2000-2014 the FFmpeg developers
built on Jun 26 2014 13:41:01 with gcc 4.9.0 (Rev4, Built by MSYS2 project)
configuration: --arch=x86_64 --disable-debug --disable-shared --disable-doc --enable-gpl --enable-version3 --enable-runtime-cpudetect --enable-avfilter --enable-bzlib --enable-zlib --enable-librtmp --enable-gnutls --enable-avisynth --enable-frei0r --enable-filter=frei0r --enable-libbluray --enable-libcaca --enable-libopenjpeg --enable-fontconfig --enable-libfreetype --enable-libass --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-libschroedinger --enable-libsoxr --enable-libtwolame --enable-libutvideo --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvo-aacenc --enable-openal --enable-libopus --enable-libvidstab --enable-libvpx --enable-libwavpack --enable-libxavs --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzvbi
libavutil 52. 90.101 / 52. 90.101
libavcodec 55. 68.100 / 55. 68.100
libavformat 55. 44.100 / 55. 44.100
libavdevice 55. 13.101 / 55. 13.101
libavfilter 4. 9.100 / 4. 9.100
libswscale 2. 6.100 / 2. 6.100
libswresample 0. 19.100 / 0. 19.100
libpostproc 52. 3.100 / 52. 3.100
[matroska,webm @ 00000000004e8f40] Could not find codec parameters for stream 2 (Subtitle: hdmv_pgs_subtitle): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[matroska,webm @ 00000000004e8f40] Could not find codec parameters for stream 3 (Subtitle: hdmv_pgs_subtitle): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[matroska,webm @ 00000000004e8f40] Could not find codec parameters for stream 4 (Subtitle: hdmv_pgs_subtitle): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, matroska,webm, from 'F:\test.mkv':
Metadata:
encoder : libebml v1.3.0 + libmatroska v1.4.1
creation_time : 2014-05-09 00:22:11
Duration: 01:57:29.22, start: 0.000000, bitrate: 6940 kb/s
Stream #0:0(eng): Video: h264 (High), yuv420p, 1280x534, SAR 1:1 DAR 640:267, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
Stream #0:1(eng): Audio: dts (DTS), 48000 Hz, 5.1(side), fltp, 1536 kb/s (default)
Stream #0:2(eng): Subtitle: hdmv_pgs_subtitle (default)
Stream #0:3(chi): Subtitle: hdmv_pgs_subtitle
Stream #0:4(chi): Subtitle: hdmv_pgs_subtitle
[rawvideo @ 0000000005df50c0] Using AVStream.codec.time_base as a timebase hint to the muxer is deprecated. Set AVStream.time_base instead.
Output #0, rawvideo, to 'NUL':
Metadata:
encoder : Lavf55.44.100
Stream #0:0(eng): Video: rawvideo (I420 / 0x30323449), yuv420p, 1280x534 [SAR 1:1 DAR 640:267], q=2-31, 200 kb/s, 23.98 fps, 23.98 tbn, 23.98 tbc (default)
Metadata:
encoder : Lavc55.68.100 rawvideo
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> rawvideo (native))
Press [q] to stop, [?] for help
Using HWAccel device 0
Input stream #0:0 frame changed from size:1280x534 fmt:yuv420p to size:1280x534 fmt:nv12
frame= 112 fps=0.0 q=0.0 size= 112140kB time=00:00:04.67 bitrate=196657.1kbits/s
frame= 264 fps=263 q=0.0 size= 264330kB time=00:00:11.01 bitrate=196657.1kbits/s
frame= 417 fps=277 q=0.0 size= 417521kB time=00:00:17.39 bitrate=196657.1kbits/s
frame= 555 fps=277 q=0.0 size= 555694kB time=00:00:23.14 bitrate=196657.1kbits/s
frame= 714 fps=285 q=0.0 size= 714892kB time=00:00:29.77 bitrate=196657.1kbits/s
frame= 865 fps=288 q=0.0 size= 866081kB time=00:00:36.07 bitrate=196657.1kbits/s
frame= 1008 fps=287 q=0.0 size= 1009260kB time=00:00:42.04 bitrate=196657.1kbits/s
frame= 1175 fps=293 q=0.0 size= 1176469kB time=00:00:49.00 bitrate=196657.1kbits/s
frame= 1344 fps=298 q=0.0 size= 1345680kB time=00:00:56.05 bitrate=196657.1kbits/s
frame= 1501 fps=299 q=0.0 size= 1502876kB time=00:01:02.60 bitrate=196657.1kbits/s
frame= 1586 fps=279 q=0.0 size= 1587982kB time=00:01:06.14 bitrate=196657.1kbits/s
frame= 1657 fps=278 q=0.0 Lsize= 1659071kB time=00:01:09.11 bitrate=196657.1kbits/s
video:1659071kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000%
Received signal 2: terminating. device zero = NVIDIA
nevcairiel
26th June 2014, 23:07
That might be the inefficient copy code, Intel GPUs are really picky how you copy the image from the GPU to system memory, and the ffmpeg CLI doesn't implement an accelerated SSE4.1 code for that, not sure it would really explain topping out at 80 fps already, but if you're at 100% of one core (ie. on a i7 at ~13%), that might be it.
Maybe I'll contribute this code to ffmpeg at some point, but like I mentioned earlier, by the developers it was mostly viewed as a way to test the hwaccel, not to use it for improved performance much.
Selur
26th June 2014, 23:07
On Windows it of course requires that both your GPUs actually have a connected screen.
Both are connected to one of the two displays I look at. :)
, not sure it would really explain topping out at 80 fps already, but if you're at 100% of one core (ie. on a i7 at ~13%), that might be it.
I get same performance when using just one cpu core, so to me it seems that on my desktop machine ffmpeg isn't really using the intel hd 4600 at all.
nevcairiel
26th June 2014, 23:12
It prints out the message about the selected hwaccel device, and it swaps to NV12 (which only the hwaccel outputs) and it never prints out an error that its not working, so I'm quite sure that it is used.
Selur
26th June 2014, 23:22
Okay, but it is still strange, that the speed is exactly the same as when only using '-threads 1' and no hwaccel.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.