-
Notifications
You must be signed in to change notification settings - Fork 200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HEVCQSV : GPU load decreasing (due to a specific option) #932
Comments
I tried to assign manully the GPU, I tried with many different input files, I tried the following hwaccel dxva2, d3dv11, qsv.......always the same : GPU load decreasing or worse, encoding not even starting. I did not mention previously, my machine is a nuc8i7hnk running Windows 10 64bit with the latest os and drivers updates, version 4.0.2 static of ffmpeg from zeranoe. I also did not mention that, natively, the script doesn't work if I only set HEVCQSV as video codec. I had to add the "load_plugin hevc" for it to work. Then I encountered the GPU load issue, that's how I came to compare MyFFMPEG and MP4 automator command lines.......I can provide video files, logs. Thanks |
Maybe you can just tell me where I need to comment your code, so Il get rid of the settings ? |
Not sure why disposition would cause an issue, but if you need to disable that feature you can knock it out by commenting out lines 111 and 112 in converter/avcodecs.py
|
I suspect that's probably an FFMPEG bug and would advise trying some different builds of FFMPEG and see if that persists |
Hey ! I'll try with another FFMPEG version and worst case, I'll comment out the lines. THANK YOU very much for your feedback !! |
No problem, let me know what the final result is |
Hi, Just been testing. I started by commenting line 111 & 112 in converter/avcodecs.py : this did not remove the "disposition" option in the FFMPEG commandline and obviously the problem is still there. Then I tried with FFMPEG static 3.4.2. Same result ?! no luck |
I've just tried the 32 bit version of both 3.4.2 and 4.02 of FFMPEG and the result is the same. Not working. Any other suggestions ? |
Hm I mean that's definitely where that FFMPEG entry comes from. I see you're on windows. Sometimes you have to delete the .pyc files that are created for those changes to take affect Also for copied audio codecs the disposition may be applied as well, you may need to also comment out lines 480 and 481 which should look essentially identical to the ones you commented out earlier |
Okay........it's getting even weirder ! Commenting out line 480 and 481 made the "disposition" option disappear in the command line but during the test using manual.py, the "GPU load" issue I described above is still occuring................. Then I stopped the script, checked the logs, found the command line that was generated and launched it manually (outside any script), the issue did not occur. I defintely think there is something wrong with the script (no offense). Any other suggestions to get a workaround or even a fix ? In any case, thank you for your help !!!! |
Can you post the full command that's generated? I wonder if its maybe an issue with the threads option? |
Please see below complete logs : 2018-10-13 15:17:00 - MANUAL - INFO - Manual processor started. built with gcc 7.3.0 (GCC) configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libmfx --enable-cuda --enable-cuvid --enable-d3d11va --enable-nvenc --enable-dxva2 --enable-avisynth libavutil 55. 78.100 / 55. 78.100 libavcodec 57.107.100 / 57.107.100 libavformat 57. 83.100 / 57. 83.100 libavdevice 57. 10.100 / 57. 10.100 libavfilter 6.107.100 / 6.107.100 libswscale 4. 8.100 / 4. 8.100 libswresample 2. 9.100 / 2. 9.100 libpostproc 54. 7.100 / 54. 7.100 Splitting the commandline. Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'. Reading option '-probesize' ... matched as AVOption 'probesize' with argument '50000'. Reading option '-analyzeduration' ... matched as AVOption 'analyzeduration' with argument '100000'. Reading option '-hwaccel' ... matched as option 'hwaccel' (use HW accelerated decoding) with argument 'dxva2'. Reading option '-i' ... matched as input url with argument 'C:\Script\Test\African Cats (2011) (1080p BluRay x265 Silence).mkv'. Reading option '-vcodec' ... matched as option 'vcodec' (force video codec ('copy' to copy stream)) with argument 'hevc_qsv'. Reading option '-map' ... matched as option 'map' (set input stream mapping) with argument '0:0'. Reading option '-vb' ... matched as AVOption 'vb' with argument '7470k'. Reading option '-tag:v' ... matched as option 'tag' (force codec tag/fourcc) with argument 'hvc1'. Reading option '-c:a:0' ... matched as option 'c' (codec name) with argument 'copy'. Reading option '-map' ... matched as option 'map' (set input stream mapping) with argument '0:1'. Reading option '-metadata:s:a:0' ... matched as option 'metadata' (add metadata) with argument 'language=eng'. Reading option '-f' ... matched as option 'f' (force format) with argument 'mp4'. Reading option '-threads' ... matched as AVOption 'threads' with argument '0'. Reading option '-load_plugin' ... matched as AVOption 'load_plugin' with argument 'hevc_hw'. Reading option '-maxrate' ... matched as AVOption 'maxrate' with argument '30000.00k'. Reading option '-pix_fmt' ... matched as option 'pix_fmt' (set pixel format) with argument 'yuv420p10le'. Reading option '-preset' ... matched as AVOption 'preset' with argument 'fast'. Reading option '-sws_flags' ... matched as AVOption 'sws_flags' with argument 'fast_bilinear'. Reading option '-qmin' ... matched as AVOption 'qmin' with argument '3'. Reading option '-qmax' ... matched as AVOption 'qmax' with argument '51'. Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'. Reading option 'C:\Script\Test\African Cats (2011) (1080p BluRay x265 Silence).mp4' ... matched as output url. Finished splitting the commandline. Parsing a group of options: global . Applying option loglevel (set logging level) with argument debug. Applying option y (overwrite output files) with argument 1. Successfully parsed a group of options. Parsing a group of options: input url C:\Script\Test\African Cats (2011) (1080p BluRay x265 Silence).mkv. Applying option hwaccel (use HW accelerated decoding) with argument dxva2. Successfully parsed a group of options. Opening an input file: C:\Script\Test\African Cats (2011) (1080p BluRay x265 Silence).mkv. [NULL @ 03bbbdc0] Opening 'C:\Script\Test\African Cats (2011) (1080p BluRay x265 Silence).mkv' for reading [file @ 03bbc500] Setting default whitelist 'file,crypto' [matroska,webm @ 03bbbdc0] Format matroska,webm probed with size=2048 and score=100 st:0 removing common factor 1000000 from timebase st:1 removing common factor 1000000 from timebase st:2 removing common factor 1000000 from timebase [matroska,webm @ 03bbbdc0] Before avformat_find_stream_info() pos: 8395 bytes read:34016 seeks:2 nb_streams:3 [hevc @ 05560060] nal_unit_type: 32(VPS), nuh_layer_id: 0, temporal_id: 0 [hevc @ 05560060] Decoding VPS [hevc @ 05560060] Main 10 profile bitstream [hevc @ 05560060] nal_unit_type: 33(SPS), nuh_layer_id: 0, temporal_id: 0 [hevc @ 05560060] Decoding SPS [hevc @ 05560060] Main 10 profile bitstream [hevc @ 05560060] Decoding VUI [hevc @ 05560060] nal_unit_type: 34(PPS), nuh_layer_id: 0, temporal_id: 0 [hevc @ 05560060] Decoding PPS [hevc @ 05560060] nal_unit_type: 39(SEI_PREFIX), nuh_layer_id: 0, temporal_id: 0 [hevc @ 05560060] Decoding SEI [hevc @ 05560060] Skipped PREFIX SEI 5 [matroska,webm @ 03bbbdc0] max_analyze_duration 100000 reached at 106000 microseconds st:1 [matroska,webm @ 03bbbdc0] Could not find codec parameters for stream 2 (Subtitle: hdmv_pgs_subtitle (pgssub)): unspecified size Consider increasing the value for the 'analyzeduration' and 'probesize' options [matroska,webm @ 03bbbdc0] After avformat_find_stream_info() pos: 11856 bytes read:66784 seeks:2 frames:8 Input #0, matroska,webm, from 'C:\Script\Test\African Cats (2011) (1080p BluRay x265 Silence).mkv': Metadata:
Duration: 01:29:24.71, start: 0.020000, bitrate: 7470 kb/s
Successfully opened the file. Parsing a group of options: output url C:\Script\Test\African Cats (2011) (1080p BluRay x265 Silence).mp4. Applying option vcodec (force video codec ('copy' to copy stream)) with argument hevc_qsv. Applying option map (set input stream mapping) with argument 0:0. Applying option tag:v (force codec tag/fourcc) with argument hvc1. Applying option c:a:0 (codec name) with argument copy. Applying option map (set input stream mapping) with argument 0:1. Applying option metadata:s:a:0 (add metadata) with argument language=eng. Applying option f (force format) with argument mp4. Applying option pix_fmt (set pixel format) with argument yuv420p10le. Successfully parsed a group of options. Opening an output file: C:\Script\Test\African Cats (2011) (1080p BluRay x265 Silence).mp4. [file @ 05599500] Setting default whitelist 'file,crypto' Successfully opened the file. [AVHWDeviceContext @ 05564de0] Using D3D9Ex device. detected 8 logical cores [hevc @ 055950e0] nal_unit_type: 32(VPS), nuh_layer_id: 0, temporal_id: 0 [hevc @ 055950e0] Decoding VPS [hevc @ 055950e0] Main 10 profile bitstream [hevc @ 055950e0] nal_unit_type: 33(SPS), nuh_layer_id: 0, temporal_id: 0 [hevc @ 055950e0] Decoding SPS [hevc @ 055950e0] Main 10 profile bitstream [hevc @ 055950e0] Decoding VUI [hevc @ 055950e0] nal_unit_type: 34(PPS), nuh_layer_id: 0, temporal_id: 0 [hevc @ 055950e0] Decoding PPS [hevc @ 055950e0] nal_unit_type: 39(SEI_PREFIX), nuh_layer_id: 0, temporal_id: 0 [hevc @ 055950e0] Decoding SEI [hevc @ 055950e0] Skipped PREFIX SEI 5 Stream mapping: Stream #0:0 -> #0:0 (hevc (native) -> hevc (hevc_qsv)) Stream #0:1 -> #0:1 (copy) Press [q] to stop, [?] for help cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[hevc @ 055950e0] cur_dts is invalid (this is harmless if it occurs once at the start per stream) nal_unit_type: 32(VPS), nuh_layer_id: 0, temporal_id: 0 [hevc @ 055950e0] cur_dts is invalid (this is harmless if it occurs once at the start per stream) nal_unit_type: 33(SPS), nuh_layer_id: 0, temporal_id: 0 [hevc @ 055950e0] cur_dts is invalid (this is harmless if it occurs once at the start per stream) nal_unit_type: 34(PPS), nuh_layer_id: 0, temporal_id: 0
[hevc @ 055950e0] nal_unit_type: 39(SEI_PREFIX), nuh_layer_id: 0, temporal_id: 0 [hevc @ 055950e0] nal_unit_type: 20(IDR_N_LP), nuh_layer_id: 0, temporal_id: 0 [hevc @ 055950e0] Decoding VPS [hevc @ 055950e0] Main 10 profile bitstream [hevc @ 055950e0] Decoding SPS [hevc @ 055950e0] Main 10 profile bitstream [hevc @ 055950e0] Decoding VUI [hevc @ 055950e0] Decoding PPS [hevc @ 055950e0] Decoding SEI [hevc @ 055950e0] Skipped PREFIX SEI 5 [hevc @ 055950e0] Decoder GUIDs reported as supported: [hevc @ 055950e0] {ee27417f-5e28-4e65-beea-1d26b508adc9} 0 [hevc @ 055950e0] {bf22ad00-03ea-4690-8077-473346209b7e} 0 [hevc @ 055950e0] {1b81be68-a0c7-11d3-b984-00c04f2e73c5} 0 [hevc @ 055950e0] {4245f676-2bbc-4166-a0bb-54e7b849c380} 0 [hevc @ 055950e0] {6719b6fb-5cad-4acb-b00a-f3bfdec38727} 0 [hevc @ 055950e0] {9901ccd3-ca12-4b7e-867a-e2223d9255c3} 0 [hevc @ 055950e0] {5b11d51b-2f4c-4452-bcc3-09f2a1160cc0} 0 [hevc @ 055950e0] {ea72396a-67ec-4781-bede-56f498f04ef2} 0 [hevc @ 055950e0] {c152ca8f-738c-461b-ad89-fc292cf8f162} 0 [hevc @ 055950e0] {514a356c-7027-4aff-8a60-afd2c1f672f1} 0 [hevc @ 055950e0] {1b81bea3-a0c7-11d3-b984-00c04f2e73c5} 0 [hevc @ 055950e0] {ca15d19a-2b48-43d6-979e-7a6e9c802ff8} 0 [hevc @ 055950e0] {7c74adc6-e2ba-4ade-86de-30beabb40cc1} 0 [hevc @ 055950e0] {107af0e0-ef1a-4d19-aba8-67a163073d13} 0 1 [hevc @ 055950e0] {65d1fa41-58af-453a-9cab-5d981156da9f} 0 1 [hevc @ 055950e0] {2db154b6-dbb2-4079-a3ff-60d7a898a6ab} 0 1 [hevc @ 055950e0] {c74a3fd0-d713-4581-a02e-8edfb112ace3} 0 1 [hevc @ 055950e0] {d79be8da-0cf1-4c81-b82a-69a4e236f43d} 0 [hevc @ 055950e0] {f9aaccbb-c2b6-4cfc-8779-5707b1760552} 0 [hevc @ 055950e0] {ed418a9f-010d-4eda-9ae3-9a65358d8d2e} 0 [hevc @ 055950e0] {d1c20509-ae7b-4e72-ae3b-49f88d58992f} 0 [hevc @ 055950e0] {103473e4-10ea-11df-9a92-2ba055d89593} 0 [hevc @ 055950e0] {84ad67f6-4c21-419a-9f0b-24f0578906c1} 0 [hevc @ 055950e0] {725ad240-786c-471e-ad3c-38f739936517} 0 [hevc @ 055950e0] {95664ff5-9e03-4c74-bb4f-9178d6035e58} 0 cur_dts is invalid (this is harmless if it occurs once at the start per stream) [hevc @ 05582a00] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0 cur_dts is invalid (this is harmless if it occurs once at the start per stream) [hevc @ 0559ede0] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0 [hevc @ 0559ede0] Output frame with POC 0. cur_dts is invalid (this is harmless if it occurs once at the start per stream) [hevc @ 0559e560] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0 [hevc @ 0559e560] Output frame with POC 1. cur_dts is invalid (this is harmless if it occurs once at the start per stream) [hevc @ 055a0be0] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0 [hevc @ 055a0be0] Output frame with POC 2. cur_dts is invalid (this is harmless if it occurs once at the start per stream) [hevc @ 0559fac0] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0 [hevc @ 0559fac0] Output frame with POC 3. cur_dts is invalid (this is harmless if it occurs once at the start per stream) [hevc @ 0559f240] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0 [hevc @ 0559f240] Output frame with POC 4. cur_dts is invalid (this is harmless if it occurs once at the start per stream) [hevc @ 0559ff00] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0 [hevc @ 0559ff00] Output frame with POC 5. cur_dts is invalid (this is harmless if it occurs once at the start per stream) [hevc @ 055a0360] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0 [hevc @ 055a0360] Output frame with POC 6. cur_dts is invalid (this is harmless if it occurs once at the start per stream) [hevc @ 055950e0] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0 cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[hevc @ 055950e0] Output frame with POC 7. [hevc @ 05582a00] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0 [hevc @ 05582a00] Output frame with POC 8. [graph 0 input from stream 0:0 @ 055979e0] Setting 'video_size' to value '1920x1080' [graph 0 input from stream 0:0 @ 055979e0] Setting 'pix_fmt' to value '335' [graph 0 input from stream 0:0 @ 055979e0] Setting 'time_base' to value '1/1000' [graph 0 input from stream 0:0 @ 055979e0] Setting 'pixel_aspect' to value '1/1' [graph 0 input from stream 0:0 @ 055979e0] Setting 'sws_param' to value 'flags=2' [graph 0 input from stream 0:0 @ 055979e0] Setting 'frame_rate' to value '24000/1001' [graph 0 input from stream 0:0 @ 055979e0] w:1920 h:1080 pixfmt:p010le tb:1/1000 fr:24000/1001 sar:1/1 sws_param:flags=2 Incompatible pixel format 'yuv420p10le' for codec 'hevc_qsv', auto-selecting format 'p010le' [format @ 05597fe0] compat: called with args=[p010le] [format @ 05597fe0] Setting 'pix_fmts' to value 'p010le' [AVFilterGraph @ 208a6d60] query_formats: 4 queried, 3 merged, 0 already done, 0 delayed [hevc_qsv @ 0558d140] No device available for encoder (device type qsv for codec hevc_qsv). [hevc_qsv @ 0558d140] Initialized an internal MFX session using hardware accelerated implementation [hevc_qsv @ 0558d140] Using the variable bitrate (VBR) ratecontrol method [hevc_qsv @ 0558d140] profile: main10; level: 306 [hevc_qsv @ 0558d140] GopPicSize: 248; GopRefDist: 9; GopOptFlag: closed ; IdrInterval: 0 [hevc_qsv @ 0558d140] TargetUsage: 4; RateControlMethod: VBR [hevc_qsv @ 0558d140] InitialDelayInKB: 3750; TargetKbps: 7470; MaxKbps: 30000 [hevc_qsv @ 0558d140] NumSlice: 1; NumRefFrame: 5 [hevc_qsv @ 0558d140] RateDistortionOpt: unknown [hevc_qsv @ 0558d140] RecoveryPointSEI: unknown IntRefType: 0; IntRefCycleSize: 0; IntRefQPDelta: 0 [hevc_qsv @ 0558d140] MaxFrameSize: 0; MaxSliceSize: 0; [hevc_qsv @ 0558d140] BitrateLimit: unknown; MBBRC: ON; ExtBRC: OFF [hevc_qsv @ 0558d140] Trellis: auto [hevc_qsv @ 0558d140] RepeatPPS: OFF; NumMbPerSlice: 0; LookAheadDS: unknown [hevc_qsv @ 0558d140] AdaptiveI: unknown; AdaptiveB: unknown; BRefType: pyramid [hevc_qsv @ 0558d140] MinQPI: 0; MaxQPI: 0; MinQPP: 0; MaxQPP: 0; MinQPB: 0; MaxQPB: 0 [hevc_qsv @ 0558d140] Main 10 profile bitstream [hevc_qsv @ 0558d140] Decoding VUI Output #0, mp4, to 'C:\Script\Test\African Cats (2011) (1080p BluRay x265 Silence).mp4': Metadata:
Clipping frame in rate conversion by 0.479530 cur_dts is invalid (this is harmless if it occurs once at the start per stream) [hevc @ 0559ede0] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0 [hevc @ 0559ede0] Output frame with POC 9. Clipping frame in rate conversion by 0.472527 cur_dts is invalid (this is harmless if it occurs once at the start per stream) [hevc @ 0559e560] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0 [hevc @ 0559e560] Output frame with POC 10. Clipping frame in rate conversion by 0.489494 cur_dts is invalid (this is harmless if it occurs once at the start per stream) [hevc @ 055a0be0] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0 [hevc @ 055a0be0] Output frame with POC 11. Clipping frame in rate conversion by 0.482506 cur_dts is invalid (this is harmless if it occurs once at the start per stream) [hevc @ 0559fac0] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0 [hevc @ 0559fac0] Output frame with POC 12. Clipping frame in rate conversion by 0.475517 cur_dts is invalid (this is harmless if it occurs once at the start per stream) [hevc @ 0559f240] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0 [hevc @ 0559f240] Output frame with POC 13. Clipping frame in rate conversion by 0.468529 cur_dts is invalid (this is harmless if it occurs once at the start per stream) [hevc @ 0559ff00] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0 [hevc @ 0559ff00] Output frame with POC 14. Clipping frame in rate conversion by 0.485497 cur_dts is invalid (this is harmless if it occurs once at the start per stream) [hevc @ 055a0360] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0 [hevc @ 055a0360] Output frame with POC 15. Clipping frame in rate conversion by 0.478508 cur_dts is invalid (this is harmless if it occurs once at the start per stream) [hevc @ 055950e0] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0 [hevc @ 055950e0] Output frame with POC 16. Clipping frame in rate conversion by 0.471519 cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[hevc @ 05582a00] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0 [hevc @ 05582a00] Output frame with POC 17. Clipping frame in rate conversion by 0.488518 cur_dts is invalid (this is harmless if it occurs once at the start per stream) [hevc @ 0559ede0] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0 [hevc @ 0559ede0] Output frame with POC 18. Clipping frame in rate conversion by 0.481499 cur_dts is invalid (this is harmless if it occurs once at the start per stream) [hevc @ 0559e560] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0 [hevc @ 0559e560] Output frame with POC 19. Clipping frame in rate conversion by 0.474510 cur_dts is invalid (this is harmless if it occurs once at the start per stream) [hevc @ 055a0be0] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0 [hevc @ 055a0be0] Output frame with POC 20. Clipping frame in rate conversion by 0.491508 cur_dts is invalid (this is harmless if it occurs once at the start per stream) [hevc @ 0559fac0] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0 [hevc @ 0559fac0] Output frame with POC 21. Clipping frame in rate conversion by 0.484520 2018-10-13 15:17:13 - MANUAL - ERROR - C:\Script\Test\African Cats (2011) (1080p BluRay x265 Silence).mp4 deleted. Here I interrupted conversion because the issue occured. FYI, it always starts after 2% of the conversion and really start to decrease after 3 or 4 % |
Out of curiosity, when using MyFFMPEG vs the script, are you using the exact same read and write destination drives? The fact that it throttles after a certain point sounds like there's a bottleneck somewhere and often that occurs when memory is saturated and it becomes limited by HDD write speeds. If you were by chance using a different drive for MyFFMPEG that may cause it. |
And the next step I would try is taking the command generated by the script and running that manually with isolated changes until you find what seems to trigger the fix. I wonder if trying to remove the 'threads' parameter might make any difference. Its set to 0 which should be auto but maybe just removing the flag all together? |
My final objective is that my current machine will convert files stored in a NAS folder (source and target will be in the same folder, but remote). But so far, all my tests are made locally : source and target are stored in a local drive (Samsung 960 Evo 1 Tb - NVME PCIE4x SSD). I have also 16 Gb of RAM. Running Windows 10 64 bit (stable not insider or whatever...) |
Also, if you run the command generated by the script manually in command prompt does that perform the same way? Another idea would be to run things and keep an eye on any obvious performance bottlenecks using resource monitor in windows that might explain why things are throttling |
Taking command line from the logs and removing "threads" option : C:\Script\ffmpeg\ffmpegRadarr.exe -loglevel debug -probesize 50000 -analyzeduration 100000 -hwaccel dxva2 -i "C:\Script\Test\African Cats (2011) (1080p BluRay x265 Silence).mkv" -vcodec hevc_qsv -map 0:0 -vb 7470k -tag:v hvc1 -c:a:0 copy -map 0:1 -metadata:s:a:0 language=eng -f mp4 -load_plugin hevc_hw -maxrate 30000.00k -pix_fmt yuv420p10le -preset fast -sws_flags fast_bilinear -qmin 3 -qmax 51 -y "C:\Script\Test\African Cats (2011) (1080p BluRay x265 Silence).mp4" FFMPEG stops converting after few frames........... |
Hm, so here's a breakdown of the differences between the two commands from your original post
Things with If we filter out stupid things like metadata inconsistencies here is the list of possible performance problems
There's a big difference in the setting for analyzeduration and probesize, I wonder if maybe that's the culprit? I doubt debug level logging would be the issue but sometimes if logging is very aggressive it can cause performance hits. The bitrate variations probably aren't the issue. Not sure about strict and async |
I tested then with the same command line as the one generated by the script but I launched it manually in a DOS command : C:\Script\ffmpeg\ffmpegRadarr.exe -loglevel debug -probesize 50000 -analyzeduration 100000 -hwaccel dxva2 -i "C:\Script\Test\African Cats (2011) (1080p BluRay x265 Silence).mkv" -vcodec hevc_qsv -map 0:0 -vb 7470k -tag:v hvc1 -c:a:0 copy -map 0:1 -metadata:s:a:0 language=eng -f mp4 -threads 0 -load_plugin hevc_hw -maxrate 30000.00k -pix_fmt yuv420p10le -preset fast -sws_flags fast_bilinear -qmin 3 -qmax 51 -y "C:\Script\Test\African Cats (2011) (1080p BluRay x265 Silence).mp4" And it works fine !!!!! |
Hm that's very strange, so the command itself is fine when running from command prompt? |
Correct......threads option is not faulty 🤔 To be honest, I don't even know the meaning of the multiple options, my only goal was for the script to generate the same command line as MyFFMPEG, which I know, works perfectly..... We can get rid of every options as long as it converts 😉 |
Hm, very strange and I'm not sure why Popen / Python would create the bottleneck Try going to converter/ffmpeg.py to line 379-380 and changing |
File start converting but GPU load decrease.... It doesn't work even with shell=True in converter/ffmpeg.py on line 379 :'( PS : I removed the converter/ffmpeg.pyc file but how can I be sure the change was taken into account ? |
Out of curiosity, could you try running on 64 bit python3 instead of python27 (not sure if you're on 64 bit or not but I would try 64) |
YESSSSSSSSSSSSSSSSSSSSSSSSS Thank you so much !!! It works fine with Python 3 64 bit |
Fantastic !! Thank you so much |
Hi,
First, a huge "thank you" for the work you do on the script !!
It works for me but not really as expected : I've noticed something really strange when using HEVCQSV (or H264QSV). Conversion starts normally, my first GPU (Intel HD630) is used at 100% and my second GPU (AMD RX Vega M GL) is loaded around 25%.
Then, depending on which option I set in the autoprocess.ini, the GPU load for both GPUs decreases consistently until reaching only few %. Obviously, this makes conversion really long, much longer than when GPUs are both used to the max.
When I use MyFFMPEG (a GUI for FFMPEG), both GPUs are used to the max (100% for Intel and 25% for AMD) until the end of the conversion.
So I decided to troubleshoot by comparing the command line used by MyFFMPEG and MP4 Automator.
Here is the commande line that is created by MyFFMPEG:
Here is my autoprocess.ini :
ffmpeg = C:\Script\ffmpeg\ffmpegRadarr.exe
ffprobe = C:\Script\ffmpeg\ffprobeRadarr.exe
threads = 0
output_directory =
copy_to =
move_to =
output_extension = mp4
output_format = mp4
delete_original = False
relocate_moov = True
video-codec = hevcqsv
video-bitrate =
video-crf =
video-max-width =
video-profile =
h264-max-level =
use-qsv-decoder-with-encoder = True
use-hevc-qsv-decoder = False
enable_dxva2_gpu_decode = True
ios-audio = False
ios-first-track-only = False
ios-audio-filter =
ios-move-last = False
max-audio-channels =
audio-codec = aac
audio-language = eng
audio-default-language =
audio-channel-bitrate = 256
audio-filter =
audio-copy-original = False
audio-first-track-of-language = False
subtitle-codec = mov_text
subtitle-language = eng
subtitle-default-language = eng
subtitle-encoding =
fullpathguess = True
convert-mp4 = True
tagfile = True
tag-language = fr
download-artwork = Poster
download-subs = False
embed-subs = True
embed-only-internal-subs = False
sub-providers = addic7ed,podnapisi,thesubdb,opensubtitles
permissions = 0777
post-process = False
pix-fmt =
aac_adtstoasc = False
postopts = -load_plugin,hevc_hw,-maxrate,30000.00k,-bufsize,30000.00k,-pix_fmt,yuv420p10le,-vsync,0,-preset,fast,-x265-params,profile=main10:me=hex:qcomp=0.5:scenecut=40:bframes=4:rc-lookahead=40:min-keyint=24:keyint=240,-sws_flags,fast_bilinear,-qmin,3,-qmax,51
preopts = -loglevel,debug,-probesize,50000,-analyzeduration,100000m
Here is the command line generated by MP4 Automator:
I discovered that if I manually remove the "-disposition:a:0 default" and manually launch the command, everything works fine from the GPU perspective.
I've tried to change every audio settings in autoprocess.ini to see if that makes any change but the "-disposition:x:0 xxxxxxxx" settings is always generated in the command line and consequently I always encounter the decrease in GPU load.
Is it a bug ? Am I doing something wrong ? I'd really like to be able to use my GPUs to encode files (I'm ok for quality loss, and so happy with the silence and the speed compared to pure CPU encoding......)
I hope you'll be able to help me. I've searched google completely two times before asking this :-D
Last but not least, I know FFMPEG supports AMD AMF encoder, would it be a lot of work to have it implemented in your script ? Thanks again
The text was updated successfully, but these errors were encountered: