View Full Version : FFMPEG not working with AVISynth+
Qaenos
19th December 2018, 04:46
I've been using FFMPEG (32 and 64-bit) with AVISynth+ quite a bit recently and all has been good until I added a single filter "GammaCurves" from the Utils-r41.avsi toolkit (http://avisynth.nl/index.php/File:Utils-r41.avsi)
The function works well with just AVISynth+, but when I use FFMPEG to make a mp4 out of my .avs script, FFMPEG starts and then just exits. If I comment out the single line to the filter, i.e. #GammaCurves(), then FFMPEG works fine with the rest of the script.
I'm not sure why FFMPEG has a problem with GammaCurves() but AVISynth+ on its own has no problem with it. Any ideas?
poisondeathray
19th December 2018, 05:22
How do you know "The function works well with just AVISynth+" ? Can you preview the script in something , like vdub2, avspmod?
I get error "Invalid arugments to function GammaCurveS"
Post your script
Qaenos
19th December 2018, 18:02
Ok so the following code "works" meaning I can run it in MPC-HC 64-bit via AVISynth+ x64 and it shows colors bars as it should:
Import("Utils-r41.avsi") # taken from (http://avisynth.nl/images/Utils-r41.avsi)
colorbars(pixel_type="yv12")
GammaCurves(1.1, 1.2, TVRange = False)
If I try to make a .mp4 via FFMPEG, such as
ffmpeg64.exe -i colorbars.avs -c:v libx264 ouput.mp4
It fails.
However, if I comment out the GammaCurve code, then I can make the mp4 with FFMPEG.
Groucho2004
19th December 2018, 18:14
Run "avsmeter64 avsinfo -log". Post the log file (avsinfo_x64.log).
Also, try running the script with AVSMeter64.
StainlessS
19th December 2018, 18:31
Qaenos,
Dont know if just a typo in post but you got a sole double quote in your ffmpeg64 line.
ffmpeg64.exe" -i colorbars.avs -c:v libx264 ouput.mp4
Groucho2004
19th December 2018, 19:34
Qaenos,
Dont know if just a typo in post but you got a sole double quote in your ffmpeg64 line.
ffmpeg64.exe" -i colorbars.avs -c:v libx264 ouput.mp4
But it apparently works when the "GammaCurves" statement is removed. Probably just a copy/paste mishap.
poisondeathray
19th December 2018, 20:10
I can reproduce the problem with ffmpeg. I tried older ffmpeg version from 2015, crash too
And the script works ok encoding with x264. It previews ok in vdub2/avspmod/mpchc .
Not audio related (killaudio has no effect)
StainlessS
19th December 2018, 20:33
Poison, can you please try rename Import("Utils-r41.avsi") removing hyphen and replace with underscore. (also on the avsi of course)
Just a whacky idea which is probably not gonna help.
poisondeathray
19th December 2018, 20:37
Poison, can you please try rename Import("Utils-r41.avsi") removing hyphen and replace with underscore. (also on the avsi of course)
Just a whacky idea which is probably not gonna help.
No effect
Renamed a copy Utils_r41.avsi
Import("Utils_r41.avsi")
#Import("Utils-r41.avsi")
Groucho2004
19th December 2018, 22:19
I can reproduce the problem with ffmpeg. I tried older ffmpeg version from 2015, crash too
I can't. It works fine for me with ffmpeg 2.8.6, 32 & 64 bit, Avisynth+ r2768, WinXP64. :confused:
poisondeathray
19th December 2018, 23:14
I can't. It works fine for me with ffmpeg 2.8.6, 32 & 64 bit, Avisynth+ r2768, WinXP64. :confused:
:confused: weird
Maybe it's XP magic!
Win 8 x64
Avisynth+ r2768 MT x64
Zeranoe ffmpeg x64 (2018.12.18) , but I tried a few others
Definitely has something to do with ffmpeg (or these ffmpeg builds) since it works with everything else, even mpv
Groucho2004
19th December 2018, 23:40
:confused: weird
Maybe it's XP magic!
Nope, no magic. Just tried on my W7Pro64 VM - works fine, both 32 and 64 bit.
poisondeathray
19th December 2018, 23:41
Nope, no magic. Just tried on my W7Pro64 VM - works fine, both 32 and 64 bit.
Can you try with a zeranoe ffmpeg build ?
Groucho2004
19th December 2018, 23:43
Can you try with a zeranoe ffmpeg build ?Got a link? just to be sure we're using the same build.
poisondeathray
19th December 2018, 23:44
Got a link? just to be sure we're using the same build.
https://ffmpeg.zeranoe.com/builds/
Groucho2004
19th December 2018, 23:49
Can you try with a zeranoe ffmpeg build ?That one (I used the latest) works too. :D
poisondeathray
19th December 2018, 23:51
That one (I used the latest) works too. :D
:(
It's not some weird plugin conflict either, because clearing out the plugin directory has no effect (and script still works with everything else)
I've never used this function before, looks like I never will ...
To be triple sure, can you download the exact avsi from the first post ? And import that version
Groucho2004
19th December 2018, 23:55
To be triple sure, can you download the exact avsi from the first post ? And import that versionI did.
I agree, it has nothing to do with plugins since this function only uses Avisynth internals. The mystery continues...
poisondeathray
19th December 2018, 23:57
I guess if you really needed it , you could use x264/x265 or something non ffmpeg ... or go to Groucho's house :D
Qaenos
20th December 2018, 00:32
Run "avsmeter64 avsinfo -log". Post the log file (avsinfo_x64.log).
Log file created with: AVSMeter 2.8.7 (x64)
[OS/Hardware info]
Operating system: Windows 10 (x64) (Build 17134)
CPU brand string: Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz
CPU features: MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2, FMA3, MOVBE, POPCNT, AES, F16C
[Avisynth info]
VersionString: AviSynth+ 0.1 (r2768, MT, x86_64)
VersionNumber: 2.60
File / Product version: 0.1.0.0 / 0.1.0.0
Interface Version: 5
Multi-threading support: Yes
Avisynth.dll location: C:\WINDOWS\SYSTEM32\avisynth.dll
Avisynth.dll time stamp: 2018-12-18, 16:54:27 (UTC)
PluginDir2_5 (HKLM, x64): C:\Apple II\AVISynth\AVSPLUS_x64\plugins
PluginDir+ (HKLM, x64): C:\Apple II\AVISynth\AVSPLUS_x64\plugins
[CPP 2.5 Plugins (64 Bit)]
C:\Apple II\AVISynth\AVSPLUS_x64\plugins\AddGrainC.dll [1.7.1.0]
C:\Apple II\AVISynth\AVSPLUS_x64\plugins\Decomb.dll [2018-11-02]
C:\Apple II\AVISynth\AVSPLUS_x64\plugins\IT.dll [2018-11-02]
[CPP 2.6 Plugins (64 Bit)]
C:\Apple II\AVISynth\AVSPLUS_x64\plugins\ConvertStacked.dll [2018-12-18]
C:\Apple II\AVISynth\AVSPLUS_x64\plugins\DePan.dll [2.13.1.3]
C:\Apple II\AVISynth\AVSPLUS_x64\plugins\DePanEstimate.dll [2.10.0.2]
C:\Apple II\AVISynth\AVSPLUS_x64\plugins\DirectShowSource.dll [2018-12-18]
C:\Apple II\AVISynth\AVSPLUS_x64\plugins\grunt-x64.dll [2016-05-17]
C:\Apple II\AVISynth\AVSPLUS_x64\plugins\ImageSeq.dll [2018-12-18]
C:\Apple II\AVISynth\AVSPLUS_x64\plugins\masktools2.dll [2.2.18.0]
C:\Apple II\AVISynth\AVSPLUS_x64\plugins\mvtools2.dll [2.7.32.0]
C:\Apple II\AVISynth\AVSPLUS_x64\plugins\nnedi3.dll [0.9.4.51]
C:\Apple II\AVISynth\AVSPLUS_x64\plugins\PlanarTools.dll [2018-12-11]
C:\Apple II\AVISynth\AVSPLUS_x64\plugins\RgTools.dll [0.97.0.0]
C:\Apple II\AVISynth\AVSPLUS_x64\plugins\Shibatch.dll [2018-12-18]
C:\Apple II\AVISynth\AVSPLUS_x64\plugins\SmoothAdjust.dll [3.2.0.0]
C:\Apple II\AVISynth\AVSPLUS_x64\plugins\TimeStretch.dll [2018-12-18]
C:\Apple II\AVISynth\AVSPLUS_x64\plugins\TIVTC.dll [1.0.11.0]
C:\Apple II\AVISynth\AVSPLUS_x64\plugins\unwiden.dll [2018-12-18]
C:\Apple II\AVISynth\AVSPLUS_x64\plugins\VDubFilter.dll [2018-12-18]
C:\Apple II\AVISynth\AVSPLUS_x64\plugins\VSFilter.dll [3.2.0.802]
C:\Apple II\AVISynth\AVSPLUS_x64\plugins\widen.dll [2018-12-18]
C:\Apple II\AVISynth\AVSPLUS_x64\plugins\yadifmod2_avx2.dll [2018-10-22]
[Uncategorized DLLs (64 Bit)]
C:\Apple II\AVISynth\AVSPLUS_x64\plugins\XySubFilter.dll [3.2.0.802]
[DLL dependencies (x64)]
C:\WINDOWS\SYSTEM32\avisynth.dll:
AVIFIL32.dll
MSVFW32.dll
MSACM32.dll
GDI32.dll
USER32.dll
ADVAPI32.dll
ole32.dll
imagehlp.dll
MSVCP140.dll
KERNEL32.dll
VCRUNTIME140.dll
api-ms-win-crt-runtime-l1-1-0.dll
api-ms-win-crt-heap-l1-1-0.dll
api-ms-win-crt-string-l1-1-0.dll
api-ms-win-crt-stdio-l1-1-0.dll
api-ms-win-crt-math-l1-1-0.dll
api-ms-win-crt-environment-l1-1-0.dll
api-ms-win-crt-filesystem-l1-1-0.dll
api-ms-win-crt-locale-l1-1-0.dll
api-ms-win-crt-utility-l1-1-0.dll
api-ms-win-crt-convert-l1-1-0.dll
api-ms-win-crt-time-l1-1-0.dll
C:\Apple II\AVISynth\AVSPLUS_x64\plugins\AddGrainC.dll:
KERNEL32.dll
C:\Apple II\AVISynth\AVSPLUS_x64\plugins\Decomb.dll:
KERNEL32.dll
C:\Apple II\AVISynth\AVSPLUS_x64\plugins\IT.dll:
KERNEL32.dll
C:\Apple II\AVISynth\AVSPLUS_x64\plugins\ConvertStacked.dll:
KERNEL32.dll
VCRUNTIME140.dll
api-ms-win-crt-heap-l1-1-0.dll
api-ms-win-crt-runtime-l1-1-0.dll
C:\Apple II\AVISynth\AVSPLUS_x64\plugins\DePan.dll:
KERNEL32.dll
C:\Apple II\AVISynth\AVSPLUS_x64\plugins\DePanEstimate.dll:
KERNEL32.dll
C:\Apple II\AVISynth\AVSPLUS_x64\plugins\DirectShowSource.dll:
WINMM.dll
QUARTZ.dll
ole32.dll
USER32.dll
OLEAUT32.dll
KERNEL32.dll
VCRUNTIME140.dll
api-ms-win-crt-string-l1-1-0.dll
api-ms-win-crt-stdio-l1-1-0.dll
api-ms-win-crt-runtime-l1-1-0.dll
api-ms-win-crt-heap-l1-1-0.dll
C:\Apple II\AVISynth\AVSPLUS_x64\plugins\grunt-x64.dll:
VCRUNTIME140.dll
api-ms-win-crt-string-l1-1-0.dll
api-ms-win-crt-heap-l1-1-0.dll
api-ms-win-crt-runtime-l1-1-0.dll
KERNEL32.dll
C:\Apple II\AVISynth\AVSPLUS_x64\plugins\ImageSeq.dll:
DevIL.dll
MSVCP140.dll
KERNEL32.dll
VCRUNTIME140.dll
api-ms-win-crt-runtime-l1-1-0.dll
api-ms-win-crt-stdio-l1-1-0.dll
api-ms-win-crt-filesystem-l1-1-0.dll
api-ms-win-crt-heap-l1-1-0.dll
C:\Apple II\AVISynth\AVSPLUS_x64\plugins\masktools2.dll:
KERNEL32.dll
MSVCP140.dll
VCRUNTIME140.dll
api-ms-win-crt-runtime-l1-1-0.dll
api-ms-win-crt-heap-l1-1-0.dll
api-ms-win-crt-convert-l1-1-0.dll
api-ms-win-crt-stdio-l1-1-0.dll
api-ms-win-crt-string-l1-1-0.dll
api-ms-win-crt-math-l1-1-0.dll
C:\Apple II\AVISynth\AVSPLUS_x64\plugins\mvtools2.dll:
KERNEL32.dll
MSVCP140.dll
VCRUNTIME140.dll
api-ms-win-crt-string-l1-1-0.dll
api-ms-win-crt-runtime-l1-1-0.dll
api-ms-win-crt-heap-l1-1-0.dll
api-ms-win-crt-stdio-l1-1-0.dll
api-ms-win-crt-math-l1-1-0.dll
api-ms-win-crt-utility-l1-1-0.dll
C:\Apple II\AVISynth\AVSPLUS_x64\plugins\nnedi3.dll:
KERNEL32.dll
VCRUNTIME140.dll
api-ms-win-crt-heap-l1-1-0.dll
api-ms-win-crt-stdio-l1-1-0.dll
api-ms-win-crt-string-l1-1-0.dll
api-ms-win-crt-runtime-l1-1-0.dll
api-ms-win-crt-math-l1-1-0.dll
C:\Apple II\AVISynth\AVSPLUS_x64\plugins\PlanarTools.dll:
MSVCP140.dll
VCRUNTIME140.dll
api-ms-win-crt-runtime-l1-1-0.dll
api-ms-win-crt-heap-l1-1-0.dll
KERNEL32.dll
C:\Apple II\AVISynth\AVSPLUS_x64\plugins\RgTools.dll:
VCRUNTIME140.dll
api-ms-win-crt-heap-l1-1-0.dll
api-ms-win-crt-runtime-l1-1-0.dll
KERNEL32.dll
C:\Apple II\AVISynth\AVSPLUS_x64\plugins\Shibatch.dll:
MSVCP140.dll
KERNEL32.dll
VCRUNTIME140.dll
api-ms-win-crt-math-l1-1-0.dll
api-ms-win-crt-heap-l1-1-0.dll
api-ms-win-crt-runtime-l1-1-0.dll
api-ms-win-crt-stdio-l1-1-0.dll
C:\Apple II\AVISynth\AVSPLUS_x64\plugins\SmoothAdjust.dll:
KERNEL32
C:\Apple II\AVISynth\AVSPLUS_x64\plugins\TimeStretch.dll:
KERNEL32.dll
VCRUNTIME140.dll
api-ms-win-crt-math-l1-1-0.dll
api-ms-win-crt-heap-l1-1-0.dll
api-ms-win-crt-runtime-l1-1-0.dll
C:\Apple II\AVISynth\AVSPLUS_x64\plugins\TIVTC.dll:
KERNEL32.dll
VCRUNTIME140.dll
api-ms-win-crt-heap-l1-1-0.dll
api-ms-win-crt-stdio-l1-1-0.dll
api-ms-win-crt-string-l1-1-0.dll
api-ms-win-crt-filesystem-l1-1-0.dll
api-ms-win-crt-runtime-l1-1-0.dll
api-ms-win-crt-math-l1-1-0.dll
C:\Apple II\AVISynth\AVSPLUS_x64\plugins\unwiden.dll:
KERNEL32.dll
MSVCP120.dll
MSVCR120.dll
C:\Apple II\AVISynth\AVSPLUS_x64\plugins\VDubFilter.dll:
USER32.dll
MSVCP140.dll
KERNEL32.dll
VCRUNTIME140.dll
api-ms-win-crt-runtime-l1-1-0.dll
api-ms-win-crt-stdio-l1-1-0.dll
api-ms-win-crt-heap-l1-1-0.dll
C:\Apple II\AVISynth\AVSPLUS_x64\plugins\VSFilter.dll:
VERSION.dll
WINMM.dll
KERNEL32.dll
USER32.dll
GDI32.dll
MSIMG32.dll
WINSPOOL.DRV
ADVAPI32.dll
SHELL32.dll
SHLWAPI.dll
UxTheme.dll
ole32.dll
OLEAUT32.dll
WININET.dll
gdiplus.dll
IMM32.dll
C:\Apple II\AVISynth\AVSPLUS_x64\plugins\widen.dll:
KERNEL32.dll
MSVCP120.dll
MSVCR120.dll
C:\Apple II\AVISynth\AVSPLUS_x64\plugins\yadifmod2_avx2.dll:
MSVCP140.dll
VCRUNTIME140.dll
api-ms-win-crt-runtime-l1-1-0.dll
api-ms-win-crt-heap-l1-1-0.dll
KERNEL32.dll
Qaenos
20th December 2018, 00:33
Qaenos,
Dont know if just a typo in post but you got a sole double quote in your ffmpeg64 line.
ffmpeg64.exe" -i colorbars.avs -c:v libx264 ouput.mp4
It was a typo on the forum, sorry. I fixed it.
Qaenos
20th December 2018, 00:35
Also, try running the script with AVSMeter64.
Just did. Here is the log:
Log file created with: AVSMeter 2.8.7 (x64)
Script file: C:\Apple II\Dropbox\MAK\Reels\Super 8mm\dekk.avs
[OS/Hardware info]
Operating system: Windows 10 (x64) (Build 17134)
CPU brand string: Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz
CPU features: MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2, FMA3, MOVBE, POPCNT, AES, F16C
[Avisynth info]
VersionString: AviSynth+ 0.1 (r2768, MT, x86_64)
VersionNumber: 2.60
File / Product version: 0.1.0.0 / 0.1.0.0
Interface Version: 5
Multi-threading support: Yes
Avisynth.dll location: C:\WINDOWS\SYSTEM32\avisynth.dll
Avisynth.dll time stamp: 2018-12-18, 16:54:27 (UTC)
PluginDir2_5 (HKLM, x64): C:\Apple II\AVISynth\AVSPLUS_x64\plugins
PluginDir+ (HKLM, x64): C:\Apple II\AVISynth\AVSPLUS_x64\plugins
[Clip info]
Number of frames: 3001
Length (hh:mm:ss.ms): 00:01:40.133
Frame width: 640
Frame height: 480
Framerate: 29.970 (30000/1001)
Colorspace: YV12
Audio channels: 2
Audio bits/sample: 32 (Float)
Audio sample rate: 48000
Audio samples: 4806401
[Runtime info]
Frames processed: 3001 (0 - 3000)
FPS (min | max | average): 1299 | 1394 | 1380
Process memory usage (max): 22 MiB
Thread count: 12
CPU usage (average): 10.0%
Time (elapsed): 00:00:02.175
[Script]
Import("C:\Apple II\Dropbox\MAK\Modules\MAK RaffRiff42.avsi")
colorbars(pixel_type="yv12")
Trim(0,3000)
GammaCurves(1.1, 1.2, TVRange = False)
[Performance data]
Frame Frames/sec Time/frame(ms) CPU(%) Threads Memory(MiB)
50 1345.664 0.743127 0.0 12 18
100 1386.786 0.721092 0.0 12 18
150 1385.016 0.722013 0.0 12 18
200 1384.754 0.722150 0.0 12 18
250 1374.941 0.727304 0.0 12 18
300 1377.823 0.725783 0.0 12 18
350 1377.471 0.725968 0.0 12 18
400 1376.999 0.726217 0.0 12 18
450 1387.236 0.720858 0.0 12 18
500 1389.219 0.719829 0.0 12 18
550 1298.718 0.769990 0.0 12 18
600 1390.858 0.718980 0.0 12 18
650 1377.055 0.726187 12.5 12 21
700 1385.128 0.721955 12.5 12 21
750 1390.453 0.719190 12.5 12 21
800 1372.750 0.728465 12.5 12 21
850 1376.343 0.726563 12.5 12 21
900 1390.208 0.719317 12.5 12 21
950 1389.624 0.719619 12.5 12 21
1000 1375.411 0.727055 12.5 12 21
1050 1370.466 0.729679 12.5 12 21
1100 1386.448 0.721267 12.5 12 21
1150 1358.825 0.735930 12.5 12 21
1200 1390.651 0.719088 12.5 12 21
1250 1376.205 0.726636 12.5 12 21
1300 1383.941 0.722574 12.5 12 21
1350 1389.699 0.719580 12.5 12 22
1400 1388.579 0.720161 12.5 12 22
1450 1377.092 0.726168 12.5 12 22
1500 1387.790 0.720570 12.5 12 22
1550 1358.753 0.735969 12.5 12 22
1600 1372.521 0.728587 12.5 12 22
1650 1390.491 0.719171 12.5 12 22
1700 1377.823 0.725783 12.5 12 22
1750 1385.540 0.721740 12.5 12 22
1800 1384.483 0.722291 12.5 12 22
1850 1389.850 0.719502 12.5 12 22
1900 1375.042 0.727250 12.5 12 22
1950 1390.293 0.719273 12.5 12 22
2000 1389.756 0.719551 12.5 12 22
2050 1367.569 0.731225 12.5 12 22
2100 1370.448 0.729689 12.5 12 22
2150 1379.268 0.725022 12.5 12 22
2200 1393.117 0.717815 12.5 12 22
2250 1390.038 0.719405 12.5 12 22
2300 1383.950 0.722569 12.5 12 22
2350 1389.765 0.719546 12.5 12 22
2400 1377.675 0.725861 12.5 12 22
2450 1388.166 0.720375 12.5 12 22
2500 1382.420 0.723369 12.5 12 22
2550 1370.832 0.729484 12.5 12 22
2600 1383.651 0.722725 12.5 12 22
2650 1377.851 0.725768 12.5 12 22
2700 1388.720 0.720087 12.5 12 22
2750 1361.414 0.734531 12.5 12 22
2800 1393.827 0.717449 12.5 12 22
2850 1386.598 0.721189 12.5 12 22
2900 1388.824 0.720034 12.5 12 22
2950 1393.401 0.717669 12.5 12 22
3000 1393.240 0.717752 12.5 12 22
Groucho2004
20th December 2018, 11:52
@Qaenos
There is nothing wrong with your Avisynth install. After pdr's and my experiments it is still unclear what the problem with the "GammaCurves()" function in conjunction with ffmpeg is.
Alternatively you could use VirtualDub2 or x264 to encode your videos.
pinterf
20th December 2018, 13:10
It seems to be an Avs+ x64 issue, please wait a bit for some further tests.
Qaenos
20th December 2018, 13:27
@Qaenos
There is nothing wrong with your Avisynth install. After pdr's and my experiments it is still unclear what the problem with the "GammaCurves()" function in conjunction with ffmpeg is.
Alternatively you could use VirtualDub2 or x264 to encode your videos.
Thank you. I've encoded the video via other tools besides FFMPEG and that's fine for now as a workaround.
Thanks for looking into it!
Groucho2004
20th December 2018, 13:50
It seems to be an Avs+ x64 issue, please wait a bit for some further tests.Maybe it depends on which instruction set is used? I have a i5 Sandy Bridge so there's no AVX2.
Qaenos' i7 has AVX2 and FMA3...
@poisondeathray
What CPU are you running?
Yanak
20th December 2018, 14:18
FFmpeg worked for me too, no problem with the script , i have a 3770k cpu, on win7 x64, using last ffmpeg and last avisynth+ ( i have both x64 and x86 installed ) if it helps.
pinterf
20th December 2018, 14:39
Yep, needed AVX2, please try with the new build (https://github.com/pinterf/AviSynthPlus/releases/tag/r2772-MT), thanks.
Qaenos
20th December 2018, 15:33
Yep, needed AVX2, please try with the new build (https://github.com/pinterf/AviSynthPlus/releases/tag/r2772-MT), thanks.
Tried it with the new build and now FFMPEG works great with GammaCurves() in! Great job, thanks!
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.