Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 22nd September 2015, 13:05   #1  |  Link
GrandAdmiralThrawn
Registered User
 
GrandAdmiralThrawn's Avatar
 
Join Date: Feb 2011
Posts: 47
Linking libav against AviSynth 2.6 (and x264 against libav) on Windows/Cygwin

Hello!

I'm not exactly sure whether this is the correct subforum, my apologies if it's the wrong one.

I noticed that modern, official x264 builds from [here] fail to load any of my AviSynth scripts (GraphEdit says my filter graph for *.avs is fine, I can play them in Windows Media Player, and it *does* work with more ancient versions of x264 just fine!). The error I get is simply like that:

Code:
lavf [error]: could not open input file
x264 [error]: could not open input file `input.avs' via any method!
So I thought if libav can't read it, I'd just build a new libav 11.4 myself, plus x264, because I am using x264's commandline tool directly. So the "linking chain" is like x264 ==linked against==> libav ==linked against==> AviSynth. I tried that on CygWin.

I have trouble linking libav 11.4 against AviSynth 2.6 however (configure option "--enable-avisynth"). At first I used the avisynth_c.h header that comes with AviSynth itself. And these errors came up while building libav using GCC 4.3.4 on a 32-Bit CygWin (avisynth_c.h is being included just fine according to config.log):

Code:
libavformat/avisynth.c:48:35: warning: avxsynth/avxsynth_c.h: No such file or directory
libavformat/avisynth.c:63: error: expected specifier-qualifier-list before 'avs_bit_blt_func'
libavformat/avisynth.c:81: error: expected specifier-qualifier-list before 'AVS_ScriptEnvironment'
libavformat/avisynth.c:100: error: 'AVS_PLANAR_Y' undeclared here (not in a function)
libavformat/avisynth.c:101: error: 'AVS_PLANAR_U' undeclared here (not in a function)
libavformat/avisynth.c:102: error: 'AVS_PLANAR_V' undeclared here (not in a function)
libavformat/avisynth.c: In function 'avisynth_load_library':
libavformat/avisynth.c:126: error: 'AviSynthLibrary' has no member named 'avs_bit_blt'
libavformat/avisynth.c:126: error: 'AviSynthLibrary' has no member named 'avs_bit_blt'
libavformat/avisynth.c:127: error: 'AviSynthLibrary' has no member named 'avs_clip_get_error'
libavformat/avisynth.c:127: error: 'AviSynthLibrary' has no member named 'avs_clip_get_error'
libavformat/avisynth.c:128: error: 'AviSynthLibrary' has no member named 'avs_create_script_environment'
libavformat/avisynth.c:128: error: 'AviSynthLibrary' has no member named 'avs_create_script_environment'
libavformat/avisynth.c:129: error: 'AviSynthLibrary' has no member named 'avs_delete_script_environment'
libavformat/avisynth.c:129: error: 'AviSynthLibrary' has no member named 'avs_delete_script_environment'
libavformat/avisynth.c:130: error: 'AviSynthLibrary' has no member named 'avs_get_audio'
libavformat/avisynth.c:130: error: 'AviSynthLibrary' has no member named 'avs_get_audio'
The errors go on and on, there's many more of the similar kind.

So then I read libavformat/avisynth.c, and there is a comment at the beginning of the source code telling me that I need to get the avisynth_c.h that comes with x264 itself, instead of the one from AviSynth 2.6. So indeed, the latest x264 does have that header included, so I linked against that instead. But the same errors happened again.

Am I doing something very wrong here? How exactly should I compile and link libav-11.4 against AviSynth 2.6 on Windows?

Thanks!
__________________

Proud owner of a 3dfx Voodoo5 6000 AGP HiNT Rev.A-3700 prototype
No RISC, no fun!
GrandAdmiralThrawn is offline   Reply With Quote
Old 22nd September 2015, 13:42   #2  |  Link
Groucho2004
 
Join Date: Mar 2006
Posts: 3,640
Quote:
Originally Posted by GrandAdmiralThrawn View Post
I noticed that modern, official x264 builds from [here] fail to load any of my AviSynth scripts
Feeding a script to the latest build you linked to (r2597, 32 Bit) works just fine here.
Groucho2004 is offline   Reply With Quote
Old 22nd September 2015, 15:11   #3  |  Link
GrandAdmiralThrawn
Registered User
 
GrandAdmiralThrawn's Avatar
 
Join Date: Feb 2011
Posts: 47
x264

Quote:
Originally Posted by Groucho2004 View Post
Feeding a script to the latest build you linked to (r2597, 32 Bit) works just fine here.
Yeah, I tried just that. I have no idea why it broke all of a sudden. I also made sure I used the x86_32 binary, and the 8-bit version as well.

If the official binaries can still do it, that'd be preferred of course, although it might still be interesting how to build this properly by myself as well.

In any case, Is there a way I can turn on some more advanced debugging in x264.exe that'd give me more verbose libav error messages as well? Passing "--log-level debug" to x264 doesn't really give any additonal output. I have no idea how to find out why it broke here, given AviSynth itself seems to work fine (according to WMP playback and GraphEdit).

Also, as said, older x264 versions also work fine (0.129.2245 in that case, linked against libavformat 54.20.4). Any ideas!?
__________________

Proud owner of a 3dfx Voodoo5 6000 AGP HiNT Rev.A-3700 prototype
No RISC, no fun!
GrandAdmiralThrawn is offline   Reply With Quote
Old 22nd September 2015, 15:59   #4  |  Link
Groucho2004
 
Join Date: Mar 2006
Posts: 3,640
Post your script and your x264 command line.
Groucho2004 is offline   Reply With Quote
Old 22nd September 2015, 16:58   #5  |  Link
GrandAdmiralThrawn
Registered User
 
GrandAdmiralThrawn's Avatar
 
Join Date: Feb 2011
Posts: 47
Solved

Of course!

Although this is no longer necessary (I found the problem, as I re-investigated my command!), this was my commandline, for animated SDTV content, to convert old and damaged DivX3/AVI files, that libav itself would choke on. I wanted to pass it through DirectShow with AviSynth to mask all the errors the files had:

Code:
"c:\Program Files (x86)\x264cli\x264.exe" --preset veryslow
--tune animation --b-adapt 2 --b-pyramid normal -f -2:0
--bitrate 500 --aq-mode 1 -p 1 --slow-firstpass
--stats v.stats -t 2 --no-fast-pskip --cqm flat
--non-deterministic --demuxer lavf "input.avs" -o pass1.264
&
"c:\Program Files (x86)\x264cli\x264.exe" --preset veryslow
--tune animation --b-adapt 2 --b-pyramid normal -f -2:0
--bitrate 500 --aq-mode 1 -p 2 --stats v.stats -t 2
--no-fast-pskip --cqm flat --non-deterministic --demuxer lavf
"input.avs" -o pass2.264
It's 2-pass, because I'm targeting file sizes. And the avs script, very basic, just one line:

Code:
DirectShowSource("video.divx", audio=false)
"video.divx" is just a DivX3 or sometimes DivX5 elementary stream demuxed from an AVI file.

Now, where was the problem? I added "--demuxer lavf" way back to skip the ffms demuxers' indexing phase for certain elementary streams fed to x264 (like MPEG2), which can take very long on slow storage backends. Since ffms was the default back then..

"--demuxer lavf" always worked on everything for me, but I assume, that nowadays this is handled by the demuxer avs, which is now a builtin in x264? So no more libav linking against AviSynth for this?

It works by just removing "--demuxer lavf" or by specifically telling x264 to use the right one by itself with "--demuxer avs".

My fault again...

Thanks for your time!

(It would still be interesting to know how to link libav 11.4 against AviSynth 2.6 though... )
__________________

Proud owner of a 3dfx Voodoo5 6000 AGP HiNT Rev.A-3700 prototype
No RISC, no fun!
GrandAdmiralThrawn is offline   Reply With Quote
Reply

Tags
avisynth, libav, link, linking, x264

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:21.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.