Skip to content
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

Closed
Bigsausage64 opened this issue Sep 18, 2018 · 28 comments
Closed

HEVCQSV : GPU load decreasing (due to a specific option) #932

Bigsausage64 opened this issue Sep 18, 2018 · 28 comments

Comments

@Bigsausage64
Copy link

Bigsausage64 commented Sep 18, 2018

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:

ffmpeg -probesize 50M -analyzeduration 100M -hwaccel dxva2 -i "input.mkv" -map 0:0 -map 0:1 -c:a aac -strict -2 -async 1 -c:v hevc_qsv -load_plugin hevc_hw -b:v 14307.84k -maxrate 28615.68k -bufsize 28615.68k -s 1920x1080 -aspect 16:9 -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 -vtag hvc1 -metadata creation_time=now -sn -y "output.mp4"

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:

ffmpeg -loglevel debug -probesize 50000 -analyzeduration 100000m -hwaccel dxva2 -i "input.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 -disposition:a:0 default -f mp4 -threads 0 -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 -y "output.mp4"

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

@Bigsausage64
Copy link
Author

Bigsausage64 commented Sep 18, 2018

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

@Bigsausage64 Bigsausage64 changed the title HEVCQSV : GPU load decreasing with some options HEVCQSV : GPU load decreasing (due to a specific option) Sep 18, 2018
@Bigsausage64
Copy link
Author

Maybe you can just tell me where I need to comment your code, so Il get rid of the settings ?

@mdhiggins
Copy link
Owner

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

        if 'disposition' in safe:
            optlist.extend(['-disposition:a:' + stream, str(safe['disposition'])])

@mdhiggins
Copy link
Owner

I suspect that's probably an FFMPEG bug and would advise trying some different builds of FFMPEG and see if that persists

@Bigsausage64
Copy link
Author

Hey !

I'll try with another FFMPEG version and worst case, I'll comment out the lines.

THANK YOU very much for your feedback !!

@mdhiggins
Copy link
Owner

No problem, let me know what the final result is

@Bigsausage64
Copy link
Author

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

@Bigsausage64
Copy link
Author

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 ?

@mdhiggins
Copy link
Owner

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

@Bigsausage64
Copy link
Author

Bigsausage64 commented Oct 13, 2018

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 !!!!

@mdhiggins
Copy link
Owner

Can you post the full command that's generated? I wonder if its maybe an issue with the threads option?

@Bigsausage64
Copy link
Author

Please see below complete logs :

2018-10-13 15:17:00 - MANUAL - INFO - Manual processor started.
2018-10-13 15:17:00 - MANUAL - INFO - C:\Python27\python.exe
2018-10-13 15:17:04 - MANUAL - INFO - Reading video stream.
2018-10-13 15:17:04 - MANUAL - INFO - Video codec detected: hevc.
2018-10-13 15:17:04 - MANUAL - INFO - Pix Fmt: yuv420p10le.
2018-10-13 15:17:04 - MANUAL - INFO - Profile: Main 10.
2018-10-13 15:17:04 - MANUAL - INFO - Reading audio streams.
2018-10-13 15:17:04 - MANUAL - INFO - Audio detected for stream #1: aac [eng].
2018-10-13 15:17:04 - MANUAL - INFO - Creating audio stream 0 from source stream 1.
2018-10-13 15:17:04 - MANUAL - INFO - Audio Track is number 1 setting disposition to default
2018-10-13 15:17:04 - MANUAL - INFO - Reading subtitle streams.
2018-10-13 15:17:04 - MANUAL - INFO - Subtitle detected for stream #2: hdmv_pgs_subtitle [eng].
2018-10-13 15:17:04 - MANUAL - INFO - {
"preopts": [
"-loglevel",
"debug",
"-probesize",
"50000",
"-analyzeduration",
"100000",
"-hwaccel",
"dxva2"
],
"subtitle": {},
"format": "mp4",
"postopts": [
"-threads",
"0",
"-load_plugin",
"hevc_hw",
"-maxrate",
"30000.00k",
"-pix_fmt",
"yuv420p10le",
"-preset",
"fast",
"-sws_flags",
"fast_bilinear",
"-qmin",
"3",
"-qmax",
"51"
],
"video": {
"profile": null,
"map": 0,
"level": null,
"codec": "hevcqsv",
"bitrate": 7470.074,
"pix_fmt": null
},
"audio": {
"0": {
"map": 1,
"language": "eng",
"channels": 6,
"codec": "copy",
"disposition": "default",
"bitrate": 1536,
"filter": null
}
}
}
2018-10-13 15:17:04 - MANUAL - INFO - Starting conversion.
2018-10-13 15:17:12 - MANUAL - ERROR - Error converting file, FFMPEG error.
Traceback (most recent call last):
File "c:\Script\Radarr\mkvtomp4.py", line 747, in convert
for timecode in conv:
File "c:\Script\Radarr\converter_init_.py", line 243, in convert
timeout=timeout, preopts=preopts, postopts=postopts):
File "c:\Script\Radarr\converter\ffmpeg.py", line 553, in convert
total_output, pid=p.pid)
FFMpegConvertError: <FFMpegConvertError error="Exited with code 1", pid=9512, cmd="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">
2018-10-13 15:17:12 - MANUAL - ERROR - 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
2018-10-13 15:17:12 - MANUAL - ERROR - ffmpeg version 3.4.2 Copyright (c) 2000-2018 the FFmpeg developers

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:

encoder         : libebml v1.3.5 + libmatroska v1.4.8

creation_time   : 2018-09-13T15:45:22.000000Z

Duration: 01:29:24.71, start: 0.020000, bitrate: 7470 kb/s

Chapter #0:0: start 0.000000, end 292.917625

Metadata:

  title           : Chapter 01

Chapter #0:1: start 292.917625, end 534.158625

Metadata:

  title           : Chapter 02

Chapter #0:2: start 534.158625, end 776.317208

Metadata:

  title           : Chapter 03

Chapter #0:3: start 776.317208, end 1199.573375

Metadata:

  title           : Chapter 04

Chapter #0:4: start 1199.573375, end 1993.700042

Metadata:

  title           : Chapter 05

Chapter #0:5: start 1993.700042, end 2509.840667

Metadata:

  title           : Chapter 06

Chapter #0:6: start 2509.840667, end 3125.038583

Metadata:

  title           : Chapter 07

Chapter #0:7: start 3125.038583, end 3555.552000

Metadata:

  title           : Chapter 08

Chapter #0:8: start 3555.552000, end 3764.260500

Metadata:

  title           : Chapter 09

Chapter #0:9: start 3764.260500, end 4496.658833

Metadata:

  title           : Chapter 10

Chapter #0:10: start 4496.658833, end 5005.792458

Metadata:

  title           : Chapter 11

Chapter #0:11: start 5005.792458, end 5364.692667

Metadata:

  title           : Chapter 12

Stream #0:0, 1, 1/1000: Video: hevc (Main 10), 1 reference frame, yuv420p10le(tv), 1920x1080, 0/1, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 1k tbn, 23.98 tbc (default)

Metadata:

  BPS             : 6947762

  BPS-eng         : 6947762

  DURATION        : 01:29:24.693000000

  DURATION-eng    : 01:29:24.693000000

  NUMBER_OF_FRAMES: 128624

  NUMBER_OF_FRAMES-eng: 128624

  NUMBER_OF_BYTES : 4659076439

  NUMBER_OF_BYTES-eng: 4659076439

  _STATISTICS_WRITING_APP: mkvmerge v17.0.0 ('Be Ur Friend') 64-bit

  _STATISTICS_WRITING_APP-eng: mkvmerge v17.0.0 ('Be Ur Friend') 64-bit

  _STATISTICS_WRITING_DATE_UTC: 2018-09-13 15:45:22

  _STATISTICS_WRITING_DATE_UTC-eng: 2018-09-13 15:45:22

  _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES

  _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES

Stream #0:1(eng), 7, 1/1000: Audio: aac (LC), 48000 Hz, 5.1, fltp (default)

Metadata:

  BPS             : 515220

  BPS-eng         : 515220

  DURATION        : 01:29:24.693000000

  DURATION-eng    : 01:29:24.693000000

  NUMBER_OF_FRAMES: 251470

  NUMBER_OF_FRAMES-eng: 251470

  NUMBER_OF_BYTES : 345500039

  NUMBER_OF_BYTES-eng: 345500039

  _STATISTICS_WRITING_APP: mkvmerge v17.0.0 ('Be Ur Friend') 64-bit

  _STATISTICS_WRITING_APP-eng: mkvmerge v17.0.0 ('Be Ur Friend') 64-bit

  _STATISTICS_WRITING_DATE_UTC: 2018-09-13 15:45:22

  _STATISTICS_WRITING_DATE_UTC-eng: 2018-09-13 15:45:22

  _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES

  _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES

Stream #0:2(eng), 0, 1/1000: Subtitle: hdmv_pgs_subtitle (default)

Metadata:

  BPS             : 16360

  BPS-eng         : 16360

  DURATION        : 01:22:31.697000000

  DURATION-eng    : 01:22:31.697000000

  NUMBER_OF_FRAMES: 766

  NUMBER_OF_FRAMES-eng: 766

  NUMBER_OF_BYTES : 10126450

  NUMBER_OF_BYTES-eng: 10126450

  _STATISTICS_WRITING_APP: mkvmerge v17.0.0 ('Be Ur Friend') 64-bit

  _STATISTICS_WRITING_APP-eng: mkvmerge v17.0.0 ('Be Ur Friend') 64-bit

  _STATISTICS_WRITING_DATE_UTC: 2018-09-13 15:45:22

  _STATISTICS_WRITING_DATE_UTC-eng: 2018-09-13 15:45:22

  _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES

  _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES

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)

Last message repeated 8 times

[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

Last message repeated 1 times

[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)

Last message repeated 15 times

[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:

encoder         : Lavf57.83.100

Chapter #0:0: start 0.000000, end 292.897625

Metadata:

  title           : Chapter 01

Chapter #0:1: start 292.897625, end 534.138625

Metadata:

  title           : Chapter 02

Chapter #0:2: start 534.138625, end 776.297208

Metadata:

  title           : Chapter 03

Chapter #0:3: start 776.297208, end 1199.553375

Metadata:

  title           : Chapter 04

Chapter #0:4: start 1199.553375, end 1993.680042

Metadata:

  title           : Chapter 05

Chapter #0:5: start 1993.680042, end 2509.820667

Metadata:

  title           : Chapter 06

Chapter #0:6: start 2509.820667, end 3125.018583

Metadata:

  title           : Chapter 07

Chapter #0:7: start 3125.018583, end 3555.532000

Metadata:

  title           : Chapter 08

Chapter #0:8: start 3555.532000, end 3764.240500

Metadata:

  title           : Chapter 09

Chapter #0:9: start 3764.240500, end 4496.638833

Metadata:

  title           : Chapter 10

Chapter #0:10: start 4496.638833, end 5005.772458

Metadata:

  title           : Chapter 11

Chapter #0:11: start 5005.772458, end 5364.672667

Metadata:

  title           : Chapter 12

Stream #0:0, 0, 1/24000: Video: hevc (hevc_qsv), 1 reference frame (hvc1 / 0x31637668), p010le, 1920x1080 [SAR 1:1 DAR 16:9], 0/1, q=3-51, 7470 kb/s, 23.98 fps, 24k tbn, 23.98 tbc (default)

Metadata:

  BPS             : 6947762

  BPS-eng         : 6947762

  DURATION        : 01:29:24.693000000

  DURATION-eng    : 01:29:24.693000000

  NUMBER_OF_FRAMES: 128624

  NUMBER_OF_FRAMES-eng: 128624

  NUMBER_OF_BYTES : 4659076439

  NUMBER_OF_BYTES-eng: 4659076439

  _STATISTICS_WRITING_APP: mkvmerge v17.0.0 ('Be Ur Friend') 64-bit

  _STATISTICS_WRITING_APP-eng: mkvmerge v17.0.0 ('Be Ur Friend') 64-bit

  _STATISTICS_WRITING_DATE_UTC: 2018-09-13 15:45:22

  _STATISTICS_WRITING_DATE_UTC-eng: 2018-09-13 15:45:22

  _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES

  _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES

  encoder         : Lavc57.107.100 hevc_qsv

Side data:

  cpb: bitrate max/min/avg: 30000000/0/7470000 buffer size: 0 vbv_delay: -1

Stream #0:1(eng), 0, 1/48000: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp (default)

Metadata:

  _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES

  BPS             : 515220

  BPS-eng         : 515220

  DURATION        : 01:29:24.693000000

  DURATION-eng    : 01:29:24.693000000

  NUMBER_OF_FRAMES: 251470

  NUMBER_OF_FRAMES-eng: 251470

  NUMBER_OF_BYTES : 345500039

  NUMBER_OF_BYTES-eng: 345500039

  _STATISTICS_WRITING_APP: mkvmerge v17.0.0 ('Be Ur Friend') 64-bit

  _STATISTICS_WRITING_APP-eng: mkvmerge v17.0.0 ('Be Ur Friend') 64-bit

  _STATISTICS_WRITING_DATE_UTC: 2018-09-13 15:45:22

  _STATISTICS_WRITING_DATE_UTC-eng: 2018-09-13 15:45:22

  _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES

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)

Last message repeated 16 times

[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.
2018-10-13 15:17:17 - MANUAL - INFO - Manual processor started.
2018-10-13 15:17:17 - MANUAL - INFO - C:\Python27\python.exe
2018-10-13 15:17:21 - MANUAL - INFO - Reading video stream.
2018-10-13 15:17:21 - MANUAL - INFO - Video codec detected: hevc.
2018-10-13 15:17:21 - MANUAL - INFO - Pix Fmt: yuv420p10le.
2018-10-13 15:17:21 - MANUAL - INFO - Profile: Main 10.
2018-10-13 15:17:21 - MANUAL - INFO - Reading audio streams.
2018-10-13 15:17:21 - MANUAL - INFO - Audio detected for stream #1: aac [eng].
2018-10-13 15:17:21 - MANUAL - INFO - Creating audio stream 0 from source stream 1.
2018-10-13 15:17:21 - MANUAL - INFO - Audio Track is number 1 setting disposition to default
2018-10-13 15:17:21 - MANUAL - INFO - Reading subtitle streams.
2018-10-13 15:17:21 - MANUAL - INFO - Subtitle detected for stream #2: hdmv_pgs_subtitle [eng].
2018-10-13 15:17:21 - MANUAL - INFO - {
"preopts": [
"-loglevel",
"debug",
"-probesize",
"50000",
"-analyzeduration",
"100000",
"-hwaccel",
"dxva2"
],
"subtitle": {},
"format": "mp4",
"postopts": [
"-threads",
"0",
"-load_plugin",
"hevc_hw",
"-maxrate",
"30000.00k",
"-pix_fmt",
"yuv420p10le",
"-preset",
"fast",
"-sws_flags",
"fast_bilinear",
"-qmin",
"3",
"-qmax",
"51"
],
"video": {
"profile": null,
"map": 0,
"level": null,
"codec": "hevcqsv",
"bitrate": 7470.074,
"pix_fmt": null
},
"audio": {
"0": {
"map": 1,
"language": "eng",
"channels": 6,
"codec": "copy",
"disposition": "default",
"bitrate": 1536,
"filter": null
}
}
}
2018-10-13 15:17:21 - MANUAL - INFO - Starting conversion.

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 %

@mdhiggins
Copy link
Owner

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.

@mdhiggins
Copy link
Owner

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?

@Bigsausage64
Copy link
Author

Bigsausage64 commented Oct 13, 2018

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...)

@mdhiggins
Copy link
Owner

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

@Bigsausage64
Copy link
Author

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...........

@mdhiggins
Copy link
Owner

Hm, so here's a breakdown of the differences between the two commands from your original post

-probesize 50M : -probesize 50000
--- : -loglevel debug
-analyzeduration 100M: -analyzeduration 100000m
-b:v 14307.84k : -vb 7470k
-strict -2 : ---
-async 1 : ---
-c:a aac : -c:a:0 copy
--- : -f mp4
--- : -threads 0
-maxrate 28615.68k : -maxrate 30000.00k
-bufsize 28615.68k : -bufsize 30000.00k
--- : -disposition:a:0 default 
--- : -metadata:s:a:0 language=eng
-s 1920x1080 : ---
-sn : ---
-s 1920x1080 -aspect 16:9 -metadata creation_time=now: ---

Things with --- are absent, things to the left of the : are from myFFMPEG, right is SMA

If we filter out stupid things like metadata inconsistencies here is the list of possible performance problems

-probesize 50M : -probesize 50000
--- : -loglevel debug
-analyzeduration 100M: -analyzeduration 100000m
-b:v 14307.84k : -vb 7470k
-strict -2 : ---
-async 1 : ---
--- : -f mp4
--- : -threads 0

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

@Bigsausage64
Copy link
Author

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 !!!!!

image

@mdhiggins
Copy link
Owner

Hm that's very strange, so the command itself is fine when running from command prompt?

@Bigsausage64
Copy link
Author

Bigsausage64 commented Oct 13, 2018

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 😉

@mdhiggins
Copy link
Owner

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 shell=False to shell=True

@Bigsausage64
Copy link
Author

Bigsausage64 commented Oct 13, 2018

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 shell=False to shell=True

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 ?

@mdhiggins
Copy link
Owner

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)

@Bigsausage64
Copy link
Author

YESSSSSSSSSSSSSSSSSSSSSSSSS Thank you so much !!! It works fine with Python 3 64 bit

@mdhiggins
Copy link
Owner

mdhiggins commented Oct 13, 2018

fckya

Good news
Guess we can close this issue haha, glad its working

@Bigsausage64
Copy link
Author

Fantastic !! Thank you so much

@Bigsausage64
Copy link
Author

Bigsausage64 commented Oct 13, 2018

You're the man !!!!!!!!!!

Plex transcoding a 4k files for sync + 1 conversion with your script both stored on NAS and look at that :

image

You made my day

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants