Avisynth ffmpeg only green frames?
Hi there.
Im having a problem getting avisynth with mpeg2source to work with ffmpeg. When i output the script to virtualdub it works fine, but encoding with ffmpeg just gives a green picture. Output to ffmpeg works with every other avs script Ive tested. When I use ffmpegsource2 the sync isnt correct. It is a bff mpeg2 source. This is the script that works fine with virtualdub but not ffmpeg for whatever reason. Code:
SetFilterMTMode("DEFAULT_MT_MODE", 2) |
I advise against use mpeg2source(), and suggest only ffvideosource() at best.
But I usually prefer to let VirtualDub or VirtualDub2/FM extract it out to a lossless intermediary, usually Lagarith on x64 systems, and then process from it. An added bonus is that Avisynth works faster with a lossless AVI. And yes, then entire extract+Avisynth is still often faster than Avisynth chewing on the MPEG. I've also started to shy away from MT mode on the non+ (and x64) builds, and I've seen too many frame glitches. If I do use it, I really have to watch it. (Not just scrub the video, but literally view it realtime.) That all said, a green picture is almost always a codec problem. |
When I use ffvideosource or ffmpegsource2 I get sync issues with mpeg2.
I tried a bunch of settings, same issues. Read a lot of places its best to use mpeg2source, because ffvideosource has sync issues as I also experienced. Doing Vdub extract is too time/space consuming. I tried using avisynth+ 64bit and 32bit, and now also with ffmpeg 32bit, with 32bit ffmpeg i can encode both 64bit and 32bit successfully with mpeg2source, but with ffmpeg 64bit I get the green picture with both 32bit and 64bit avisynth. Its only applicable to mpeg2source, avisource has been working perfectly with ffmpeg 64bit. I also tried different version of ffmpeg, static zeranoe had same issue. Another issue, encoding time. Now its encoding 1x-1,5x max. ffmpeg: Code:
-c:v libx264 -preset slower -crf 17 -aspect 4:3 -c:a libfdk_aac -b:a 384k -ar 48k -afterburner 1 Code:
SetFilterMTMode("DEFAULT_MT_MODE", 2) Sources are mostly SD material from DV. Im using Threadripper 1950X |
Please use [code][/code] tags around Avisynth and ffmpeg scripts. Or any scripts.
The # in the reply box is also the code editor. |
Ok, will do.
|
Quote:
|
Haven't experienced any issues like this when using 64-bit ffmpeg, though there should be hardly any difference between 32 and 64-bit speed-wise in any case. The performance critical parts of the code are mostly hand-optimized stuff where it selects different implementations based on the capabilities of the CPU. What color space are you getting on the avisynth output (avspmod can be used to check)? It's possible that the different source plugins outputs in different color spaces, and that's one area where ffmpeg could get confused.
Quote:
There is a package containing vapoursynth + needed plugins here: https://forum.doom9.org/showthread.php?t=175529 Also note that the DV format is full-range YUV, as opposed to like every other video format where 16-235 are the values meant for display, so you may want to adjust the video levels accordingly, or you may get blown out darks and whites. In my experience material from miniDV tapes tend to use the full range up to y=255, but often only go down to somewhere between 12-16, so it might be worth looking at a histogram. No idea about the stuff the canopus boxes produce. |
Quote:
Sync errors are no fun, having one myself on a hobby project, hoping to finish by end of year. |
Hi. A small update.
I'm still having problems getting avisynth+ 64bit to work correctly. I've tried the other version as well, but they are much slower and the regular MT-version just quits randomly. ST is max 0.3X, and if I start a bunch of them, I can get it to a total of 2X, but after some time and after most of them finishes, the speed drops to 0.1X. So that´s not really an option as I see it. I used the universal installer at doom9.org to test the different versions. And the 64bit avs+ is what seems fastest, and never once has it quit or stopped working. I have mtmodes.avsi in the plugins folder. http://publishwith.me/ep/pad/view/ro.rDkwcdWn4k9/latest That's the correct way to do it, right? Just copy the text and save it as mtmodes.avsi in the plugins folder? I have all the latest Core Plugins and scripts for 64bit for qtgmc http://avisynth.nl/index.php/QTGMC NNEDI3, I copied the W7_AVX2 plugin. Guess that's correct? I have two ffmpeg encodings going simultaneously as I can't get full speed on one single encoding. Sometimes I have a total of 1X, sometimes 0.7X, and sometimes 2x but always 100% cpu, with the same scripts, even at slow speed around 0.5X, it still shows 100% cpu, nothing else is running. This is the script I´m using to test. Code:
SetFilterMTMode("DEFAULT_MT_MODE", 2) This is what seems fastest on my PC. Settings edithreads=1 makes it slower, but not much difference above 2. I guess you're not supposed to use edithreads with avs+? Any experience with this? On the qtgmc site it says only the regular MT version is supported, but that just stopped randomly all the time. Maybe 32bit memory problem? Tried different setmemorymax values, but same problem with the 32bit MT version. I'm thinking its the amount of logical cores that's the main problem here. Threadripper has 32. I've tried higher values for prefetch, but still not faster, and it then eats up all of the cpu at low speeds. Any suggestions would be greatly appreciated. :) |
I use this for simple QTGMC in Avisynth+ x64
Code:
SetFilterMTMode("DEFAULT_MT_MODE", 1) But I'll tweak the QTGMC based n the source quality/needs. |
Quote:
There is going to be a limit to how many threads the plugins can use effectively, so you may simply have hit that limit with avs64+. You could try if vapoursynth is faster. Did you figure out the green frames issue? |
Quote:
Do you mux it in while encoding, or afterwards? Quote:
|
Finally! :)
Added this to the beginning of every script: Code:
AddAutoloadDir("PATH\AvisynthRepository\AVSPLUS_x64\plugins") |
Quote:
VapourSynth is just great, hard to get into it in the beginning, and not that much information for newbies, but understood it in the end and got it working. Avisynth+ 64bit was working ok enough, but when it came to 1080i MPEG2TS it maxed out around 0.3X, 0.4X with 100% cpu usage. VapourSynth is working steadily at 0.8X with same settings on QTGMC at 75-80% cpu usage. Over all it feels much more stable. Had these strange spikes with Avisynth and Windows was working really slowly in times when encoding was going on in the background, even with affinity and priority set. Have not had this problem with VapourSynth. With mpeg2 sources i found that only PS works without sync issues, after a stream fix with some bad sources. And also ffms2 with VapourSynth drops some of the first frames in MPEG2 streams and D2Vsource was buggy. L-SMASH Source works perfectly. Maybe its different with DVD, havent tested that yet with VapourSynth. Have any advice about the levels you mentioned with DV sources? I tried TV>PC with coloryuv, but not correct output in my eyes. |
I use something like this, adjusting levels with the Levels function:
Code:
import vapoursynth as vs |
Thank you! :)
Code:
core = vs.get_core(threads=4) Usually use around 2-6 threads, and leave rest for encoder. Code:
SET ffmpeg=start "ffmpeg" /low /b /w /AFFINITY 0000FFF0 ffmpeg Code:
SET ffmpeg=start "ffmpeg" /low /b /w /AFFINITY 0FFF0000 ffmpeg Quote:
|
Wasn't actually aware about specifying number of threads, it's supposed to autodetect the number of cores. Didn't notice a difference on a 4-core i5, but I suppose it may make more of a difference on a threadripper with loads of cores.
The reference suggests getting the core instance like this now though, get_core is apparently deprecated: Code:
core = vs.core |
Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.