[HELP] Random FFmpeg crashes when using Hybrid / Avisynth - Printable Version +- Selur's Little Message Board (https://forum.selur.net) +-- Forum: Hybrid - Support (https://forum.selur.net/forum-1.html) +--- Forum: Problems & Questions (https://forum.selur.net/forum-3.html) +--- Thread: [HELP] Random FFmpeg crashes when using Hybrid / Avisynth (/thread-977.html) Pages:
1
2
|
Random FFmpeg crashes when using Hybrid / Avisynth - The_Tinkerer - 19.04.2019 I don't expect anyone to be able to figure this out due to the highly idiosyncratic and esoteric nature of the problem. But, I have wasted days on this now and I am tearing my hair out trying everything to troubleshoot this, to no avail. The problem is, when I try to run jobs using Hybrid with Avisynth, I get flaky and unstable behavior. Sometimes, FFmpeg randomly crashes at random points in the job. Sometimes, all CPU activity stalls with no crash, but the job is now stuck. I can usually reset and restart the job and it will complete the second or third time. Log Name: Application I now have a job that I am unable to complete without a crash or stall. I have to set the number of MT threads to 12 in the Avisynth Misc tab or the job will run WAY too slow. All 6 cores are used, but the CPU utilization is never more than 20% and the performance is "spiky" in Task Manager, meaning there are only short "bursts" or spikes of activity in between no activity on all cores. In addition to that, sometimes when starting Hybrid I get random crashes; all I can do is close and restart. It usually runs on restart. Sometimes I will get two crashes in a row until restarting successfully. Log Name: Application I seem to be able to run Vapoursynth without issue. The reason I am using Avisynth is I am using amDCT Deblocker, which is not available in Vapoursynth. I suspect that this filter is what is causing most of the instability, but when it works it gives me the best results for what it does. Do you have ANY idea on how to go about troubleshooting this? I did try replacing C:\Program Files\Hybrid\32bit\ffmpeg.exe with ffmpeg.exe x86 version 4.1.1 (the latest release build), but it had no effect. CPU-Z: CPUZ.txt in Logs.zip I have 5 logs. The only thing different between the logs are settings on the Avisynth Misc tab. Red boxes show what is changed from default settings. Here's the Avisynth script: LoadPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\LoadDll.dll") x264: x264 --preset veryslow --crf 16.00 --profile high --level 4.2 --ref 4 --b-adapt 1 --vbv-maxrate 62500 --vbv-bufsize 78125 --threads 6 --sar 1:1 --qpfile GENERATED_QP_FILE --non-deterministic --range tv --colormatrix bt709 --demuxer raw --input-res 1920x1080 --input-csp i420 --input-range tv --input-depth 8 --fps 60/1 --output-depth 8 --output "C:\Users\Administrator\AppData\Local\Temp\Test (Post).264" - Before every job, I did Config -> Reset All, and Hybrid restarts. I then set Config -> Path -> Default output path, and Internals -> Create debug file, level: 9. 01_HybridDebugOutput_CRASH_Default_Mem.txt: FFmpeg crash 02_HybridDebugOutput_STALL_3072_NoDoub_Mem.txt: CPU stall, all activity stopped 03_HybridDebugOutput_CRASH_1536_Mem_Nodistrib.txt: FFmpeg crash 04_HybridDebugOutput_SLOW_Misc_Def.txt: User stopped due to job running extremely slow 05_HybridDebugOutput_CRASH_LibavVideoSource_1536_Mem.txt: FFmpeg crash Unable to attach Logs.zip, using external source: https://bit.ly/2PlaWaL RE: Random FFmpeg crashes when using Hybrid / Avisynth - Selur - 19.04.2019 Threading costs lots of RAM. So if the whole thing get's instable when you use more threads it's probably a memory limit issue. Avisynth+ how Hybrid uses it, is 32bit only and thus is limited to <4GB RAM usage. Vapoursynth on the other hand is 64bit and thus not so limited in regards of RAM. You can use AVSMeter (https://forum.doom9.org/showthread.php?t=174797), simply copy the AVSMeter.exe into your Hybrid/32bit folder and it should work fine and call it inside a Windows Command Prompt. Disabling 'add distributor()' is an Avisynth MT option, by default Avisynth+ is used so that won't do a thing. Assuming you got AVSMeter running, try whether it helps if you add: SetMemoryMax(768) Cu Selur Ps.: As side notes: a. in theory one could use Avisynth filters inside Vapoursynth, problem is there isn't a 64bit version of amDCT so that wouldn't help either. b. higher cpu usage with Avisynth doesn't necessary have to mean higher speed c. wondering why FFVideoSource is used for your source, when 'LibavVideoSource instead of FFmpegSource' is enabled. d. Instead of using FFmpeg as Avisynth Script interpreter, you could also try avs2yuv (by disabling 'Prefer FFmpeg as decoder' and enabling 'Prefer avs2yub to decoder') this might lower the memory usage a tiny bit. (will probably not really fix the issue) RE: Random FFmpeg crashes when using Hybrid / Avisynth - The_Tinkerer - 19.04.2019 AVSMeter.exe is already in the Hybrid\32bit folder. It looks like it's included as part of the Hybrid install. Unfortunately I'm not savvy enough to figure out how to use it. Can you give me more info as to how to use it to add "SetMemoryMax(768)" as you describe? Do I do this somewhere within Hybrid, or do I run AVSMeter.exe separately? I did try searching and all I could find is a reference to AVSMeter being used for the "Limit benchmark (%)" option. But even though that is checked by default, I don't see AVSMeter.exe in task manager as a running process when a job is running. I also tried avs2yuv so that it runs instead of ffmpeg, but that just crashed the same way as ffmpeg does, so you're right, that didn't fix it. RE: Random FFmpeg crashes when using Hybrid / Avisynth - Selur - 19.04.2019 a. yes, AvsMeter comes with Hybrid, but it isn't used during the job processing. It's only used to benchmak avisynth scripts. (Filtering->Benchmark) The AvsMeter version which comes with Hybrid probably isn't up-to-date. b. You don't use AvsMeter to add that part you edit your script and call it with AvsMeter inside a command prompt. "Path to AvsMeter"" "PATH TO YOUR AVISYNTH FILE" Cu Selur RE: Random FFmpeg crashes when using Hybrid / Avisynth - The_Tinkerer - 20.04.2019 Understood. The AVSMeter version included with Hybrid is up to date. It also crashed. With the Avisynth script direct from Hybrid: C:\Program Files\Hybrid\32bit>avsmeter "TestScript.avs" With the same script with SetMemoryMax(768) added to the beginning: C:\Program Files\Hybrid\32bit>avsmeter "TestScript.avs" Any other ideas? RE: Random FFmpeg crashes when using Hybrid / Avisynth - The_Tinkerer - 20.04.2019 I tried doing a SetMemoryMax(512) and it still crashed. I'm not sure that this is an issue with too much memory being used in a x86 environment. I suspect it's amDCT bugginess. I don't think the author's updated it for quite some time. It's too bad there's not a good equivalent to it in Vapoursynth. RE: Random FFmpeg crashes when using Hybrid / Avisynth - Selur - 20.04.2019 According to the numbers AVSMeter provides it isn't an issue with the memory allocation. < 1.4GB is definitely save. This looks like: a. a bug in a filter (try whether this also happens if you disable amDCT and/or LSFmod and/or Interframe to narrow down which filter causes the problem) b. something interfering with avisynth filter (some overzealous firewall or av solution? <- try disabling those while testing) c. some problem with the memory Cu Selur RE: Random FFmpeg crashes when using Hybrid / Avisynth - The_Tinkerer - 20.04.2019 Yeah I forgot to mention the only Anti Virus I'm using is built in Windows Defender. And also built in Windows Firewall. Thanks for taking the time to respond so quickly, I appreciate it. RE: Random FFmpeg crashes when using Hybrid / Avisynth - Selur - 20.04.2019 So it's either one of the used filters or a memory problem. Cu Selur RE: Random FFmpeg crashes when using Hybrid / Avisynth - The_Tinkerer - 21.04.2019 Thanks for the help. I've narrowed the problem down to amDCT. Not sure if using it with a different version of Avisynth would make a difference. There's a support thread but I don't have a Doom9 account and they make new users wait 5 days before being able to post, to keep out spammers. (Also keeping out legit users, but oh well.) The author did release a "Testing" version 1.1 update in January 2019, I tried it and it still crashed. |