Log in

View Full Version : FFmpegSource


Pages : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 [16] 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60

LoRd_MuldeR
27th January 2010, 22:16
Great, so my build is currupt after all.
I downloaded the latest MinGW but it came with gcc 3.4.5. How do I update it to 4.3 or 4.4?

http://komisar.gin.by/mingw/index.html

http://www.xvidvideo.ru/2009-10-22-10-49-14/cat_view/28-cross-mingwgcc-x86x64.html

http://www.tdragon.net/recentgcc/

moviefan
28th January 2010, 18:38
Can someone please explain how to compile the avisynth dll file with MSVC? I get "Library autodetection failed. If you get unresolved externals, you may have to edit src/config/config.h manually." when I try to compile the project. The documentation is pretty poor I must say...

TheFluff
28th January 2010, 21:29
You probably didn't add your mingw include/lib paths to the MSVC search path (hint: tools -> options -> projects and solutions -> VC++ directories). The documentation isn't poor at all, it's just out of date. It also tells you exactly what you need to know, it just assumes you at least have some faint idea about what you're doing. Additional hints have also been posted in multiple places in this thread. A step-by-step "press this button, then this one, then this one" guide will never be written, at least not by me.

The Windows build process is fairly complicated because of the two different compilers and environments involved; unlike under Unix you probably have no business building it yourself unless you have a very good reason for doing so (read: debugging it, and if you can't even get it to compile you probably can't figure out how to debug it either).

moviefan
28th January 2010, 22:02
I added the include and the lib path to MSVC and now I get a lot of (they look like) syntax errors. Over a hundred... Building totally fails. Any other ideas?

TheFluff
29th January 2010, 01:29
yes, try one of:
a) make us psychic so we can magically tell what's up, or
b) paste some of the error messages

Jeremy Duncan
29th January 2010, 07:25
Can someone please explain how to compile the avisynth dll file with MSVC?

\\\\ I wanna build my own. How do I do it?

Follow the instructions in this link: link (http://forum.doom9.org/showthread.php?t=145130)


A.) You will need to use the sw in the link at the top of the link as the instructions for other versions are different.

B.) The youtube video showing avisynth compilation is for the official 2.5.8 version, not my mt version.
To compile my version you setup visul studio as shown in the video then unzip my src and change to release in configuration manager (in visual studio). Then you build the soundtouch, softwire, pfc then you build avisynth.dll

C.) when you build the softwire, soundtouch, pfc, avisynth.
Highlight the one your going to build then from the "build tab, project only, build only" on the top menu.
You build only the one thing at a time, or else you will get a bunch of errors and that's not cool. :)

D.)

1.) Once the dll is made then go to the avisynth src folder, release and get the avisynth dll and put it on your desktop.

2.) Then go and get the upx.exe from google, windows console version, and put the upx.exe on your desktop.

3.) Then open cmd prompt in admin and go to the desktop using the cd command as shown in the link to how to build the dll. Example: cd C:\Users\aye\Desktop

4.) Then with cmd prompt still open and both the upx.exe and avisynth dll on the desktop, in cmd prompt type: upx avisynth.dll
and then press enter and it will reduce the size of your dll!

5.) Then you put it in place of the other one in the system32 folder and reboot twice and then test your new dll.

Watch these videos in my upload list over at youtube:
setup visual studio part 1
setup visual studio part 2
Build Avisynth dll. Part 3
link (http://www.youtube.com/user/foxhoundfan)

burfadel
29th January 2010, 10:12
Anyone got an avisynth/staxrip compatible up to date build? It seems strange its not more widely available since its covers most sources, and is faster than the avisource/directshowsource/mpeg2source equivalents (I've always been using the latest ffmpeg).

I had a go at building my own files a while ago but had so many problems I spent a lot of time getting it to work. Two days later my main drive and backup drive failed within 2 reboots, of course naturally the first thing to do was to turn the power off, check the cabling etc. After having the hassle of dealing with Seagate for a couple of months it put me right off! (the drives were affected by the bricking scenario Seagate denied and refused to fix for way too long)

me7
29th January 2010, 11:42
The Windows build process is fairly complicated because of the two different compilers and environments involved; unlike under Unix you probably have no business building it yourself unless you have a very good reason for doing so (read: debugging it, and if you can't even get it to compile you probably can't figure out how to debug it either).

Right now there is a very good reason for everybody to build it themselves: x264 has changed the way it handles inputs, the latest official FFmpegSource build can report a false framerate to avisynth which x264 started to depend on in recent builds. This bug has been fixed in the repository but no updated build was released.
It might be a good idea to release an official build that is compatible with x264, or you could soon see more noobs asking even more trivial questions then me.

rack04
29th January 2010, 17:16
Is it possible to build 64bit ffms2 for use in 64bit x264? Looking at the ./configure -h I found the following options. Will this work?

./configure --prefix="/c/MinGW/x86_64-pc-mingw32" --build="x86_64-pc-mingw32" PKG_CONFIG="/c/MinGW/x86_64-pc-mingw32/bin/pkg-config.exe" CFLAGS="-march=core2"

Abradoks
29th January 2010, 21:29
Is it possible to build 64bit ffms2 for use in 64bit x264?
kemuri builds it for x64, but he uses his own makefiles. I hope current buildsystem works too, but I haven't tried it yet.

For those who ask for compiled Avisynth library, here is r273 (http://rghost.ru/907880). Works for me, but not tested well.

MuLTiTaSK
29th January 2010, 22:40
@Abradoks

i just did some quick tests with StaxRip with no problems :thanks:

burfadel
30th January 2010, 01:52
kemuri builds it for x64, but he uses his own makefiles. I hope current buildsystem works too, but I haven't tried it yet.

For those who ask for compiled Avisynth library, here is r273 (http://rghost.ru/907880). Works for me, but not tested well.

Thanks! The up to date build is much appreciated, it works fine here too! I used it in combination with a ffmsindex binary built by Kemuri (no avisynth dll though).

Did you build this one your Abradoks?

TheFluff
30th January 2010, 01:55
Right now there is a very good reason for everybody to build it themselves: x264 has changed the way it handles inputs, the latest official FFmpegSource build can report a false framerate to avisynth which x264 started to depend on in recent builds. This bug has been fixed in the repository but no updated build was released.
It might be a good idea to release an official build that is compatible with x264, or you could soon see more noobs asking even more trivial questions then me.
There are multiple people who compile x264 with ffms2 support for windows, use one of those builds. I don't recommend doing it yourself because of the large risk of screwing things up or building rather suboptimal ffmpegs (ask me about mingw fun sometime). Of course, if you know what you're doing (i.e. you're not having basic wait-which-button-should-I-press issues in visual studio) feel free to go ahead.

Also, that bug is extremely minor and I'm pretty sure the only reason Dark Shikari harassed me so much about it is that he's anal; I fail to see how it could present a practical problem for anyone. The reported fps in question isn't false at all, it's the average framerate (or a guessed framerate based on the duration of the first frame, depending on the demuxer used). For CFR files it's reasonably accurate; if you want an anally correct CFR framerate use --fps. If the source is VFR it's a completely meaningless number anyway and since x264 doesn't support VFR ratecontrol yet you'll still have to do the numbers by hand like you've always had to when encoding VFR.

e: the reason I'm not providing my own builds is because I'm not using an optimal version of gcc. I also build with UTF8 support enabled, which breaks API compatibility with programs that only pass the local charset, and I'm too lazy to turn it off and un-patch ffmpeg to disable it. Get TheRyuu to make y'all a ffmpeg-mt build or something.

Is it possible to build 64bit ffms2 for use in 64bit x264? Looking at the ./configure -h I found the following options. Will this work?

As mentioned, it's supposedly possible to build a x64 ffms2 this way, but you won't get the Avisynth part, just the library. As far as I know it is currently impossible to build an x64 ffms2 Avisynth plugin, not that anyone would want one anyway.

kemuri-_9
30th January 2010, 02:22
As mentioned, it's supposedly possible to build a x64 ffms2 this way, but you won't get the Avisynth part, just the library. As far as I know it is currently impossible to build an x64 ffms2 Avisynth plugin, not that anyone would want one anyway.

only if you want it to be compiled in msvc for the standard avs C++ interface.
if you compile it in mingw utilizing the avs C interface it's possible, and my ffms dll builds have been including the avs C interface code so you can LoadCPlugin on them just fine.
(excluding the fact that squid_80's avs x64 doesn't have LoadCPlugin for some unknown reason and requires to have it added via a separate plugin)

TheFluff
30th January 2010, 02:45
I know that you have done that. I also know that doing it requires patching ffms2 (basically rewriting half the avisynth plugin) and that your patch that does so currently seems unavailable to the general public (the only link to it that I can find 404's). Hence my statement that it is, to the extent of my knowledge, currently impossible to do with the current codebase.

e: I found a patch (http://kemuri9.net/dev/avs/ffms2/svn.diff) that seems to do something like it, along with a ton of other stuff. I haven't looked closely at it though.

kemuri-_9
30th January 2010, 07:54
e: I found a patch (http://kemuri9.net/dev/avs/ffms2/svn.diff) that seems to do something like it, along with a ton of other stuff. I haven't looked closely at it though.

yes, that's the patch i have against the svn (don't quite remember the r# but as it doesn't generally have any reason to create a conflict it should apply ok to any one of them), which is my build system with the avisynth code.
the first half or so is the avisynth code, the latter half is the build system that i've been using to compile my builds

Abradoks
30th January 2010, 09:55
Did you build this one your Abradoks?
Yes, I built it myself using MSVC.
I don't recommend doing it yourself because of the large risk of screwing things up or building rather suboptimal ffmpegs (ask me about mingw fun sometime).
BTW is --enable-runtime-cpudetect (which is widely used) currently working? I mean, does it automatically detect best cpu flags or does it use general C code if nobody specified sws_flags?
the reason I'm not providing my own builds is because I'm not using an optimal version of gcc. I also build with UTF8 support enabled, which breaks API compatibility with programs that only pass the local charset, and I'm too lazy to turn it off and un-patch ffmpeg to disable it.
Does that UTF-8 patch make any difference for Avisynth dll?

SledgeHammer_999
30th January 2010, 13:02
Help me compile ffms2 r273.

I compiled zlib and ffmpeg without problems throught msys/mingw(4.4.1). All the header file are in "C:\mingw\1.0\local\include" and all the lib files are in "C:\mingw\1.0\local\include\lib"

Then I opened the "ffms2.vcproj" from the build-msvc directory. I opened the following dialog: Project->Properties

Then I selected C/C++ -> General. Then in Additional Include directories I put "C:\mingw\1.0\local\include" and before that the path to the stdint.h/inttypes.h headers.
Then I selected Linker -> General. Then in Adittional Library directories I put "C:\mingw\1.0\local\include\lib".
I hit OK.

Then I do a Build->Build ffms2.

I get these errors:

1>------ Build started: Project: ffms2, Configuration: Release Win32 ------
1>Performing Pre-Build Event...
1>Library autodetection failed. If you get unresolved externals,
1>you may have to edit src/config/config.h manually.
1>Project : error PRJ0019: A tool returned an error code from "Performing Pre-Build Event..."
1>Build log was saved at "file://c:\LIBRARIES\ffms\build-msvc\Release\BuildLog.htm"
1>ffms2 - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

The contents of BuildLog.htm are

Build Log


Build started: Project: ffms2, Configuration: Release|Win32

Command Lines


Creating temporary file "c:\LIBRARIES\ffms\build-msvc\Release\BAT00001430603464.bat" with contents
[
@echo off

call ./msvc_autoconf.bat

if errorlevel 1 goto VCReportError

goto VCEnd

:VCReportError

echo Project : error PRJ0019: A tool returned an error code from "Performing Pre-Build Event..."

exit 1

:VCEnd
]
Creating command line """c:\LIBRARIES\ffms\build-msvc\Release\BAT00001430603464.bat"""

Output Window


Performing Pre-Build Event...
Library autodetection failed. If you get unresolved externals,
you may have to edit src/config/config.h manually.
Project : error PRJ0019: A tool returned an error code from "Performing Pre-Build Event..."

Results


Build log was saved at "file://c:\LIBRARIES\ffms\build-msvc\Release\BuildLog.htm"
ffms2 - 1 error(s), 0 warning(s)


What am I missing?

Abradoks
30th January 2010, 13:39
What am I missing?
Remove msvc_autoconf.bat from prebuild events (because it never works) and edit src/config/msvc-config.h manually if needed (config.h was renamed into msvc-config.h, but neither msvc project nor batch file was changed).

SledgeHammer_999
30th January 2010, 14:01
Remove msvc_autoconf.bat from prebuild events (because it never works) and edit src/config/msvc-config.h manually if needed (config.h was renamed into msvc-config.h, but neither msvc project nor batch file was changed).

Still some problems. When I hit "build ffms2" I get:

1>------ Build started: Project: ffms2, Configuration: Release Win32 ------
1>Compiling...
1>libs.cpp
1>ffswscale.cpp
1>ffpp.cpp
1>avsutils.cpp
1>avssources.cpp
1>avisynth.cpp
1>wave64writer.cpp
1>utils.cpp
1>ffms.cpp
1>videosource.cpp
1>matroskavideo.cpp
1>..\src\core\matroskavideo.cpp(39) : warning C4355: 'this' : used in base member initializer list
1>lavfvideo.cpp
1>..\src\core\lavfvideo.cpp(33) : warning C4355: 'this' : used in base member initializer list
1>haalivideo.cpp
1>matroskaindexer.cpp
1>lavfindexer.cpp
1>indexing.cpp
1>c:\mingw\1.0\local\include\zconf.h(289) : fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory
1>haaliindexer.cpp
1>matroskaaudio.cpp
1>..\src\core\matroskaaudio.cpp(36) : warning C4355: 'this' : used in base member initializer list
1>lavfaudio.cpp
1>..\src\core\lavfaudio.cpp(33) : warning C4355: 'this' : used in base member initializer list
1>haaliaudio.cpp
1>Compiling...
1>audiosource.cpp
1>Build log was saved at "file://c:\LIBRARIES\ffms\build-msvc\Release\BuildLog.htm"
1>ffms2 - 1 error(s), 4 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

When I add to the include paths the "C:\mingw\include"(that's where unistd.h is) I get a huge amount of errors. The first few are:

1>------ Build started: Project: ffms2, Configuration: Release Win32 ------
1>Compiling...
1>libs.cpp
1>ffswscale.cpp
1>C:\mingw\include\wchar.h(155) : error C2373: '__restrict__' : redefinition; different type modifiers
1> C:\mingw\include\wchar.h(154) : see declaration of '__restrict__'
1>C:\mingw\include\wchar.h(157) : error C2086: 'const wchar_t *__restrict__' : redefinition
1> C:\mingw\include\wchar.h(156) : see declaration of '__restrict__'
1>C:\mingw\include\wchar.h(168) : error C2373: '__restrict__' : redefinition; different type modifiers
1> C:\mingw\include\wchar.h(168) : see declaration of '__restrict__'
1>C:\mingw\include\wchar.h(169) : error C2373: '__restrict__' : redefinition; different type modifiers
1> C:\mingw\include\wchar.h(169) : see declaration of '__restrict__'
1>C:\mingw\include\wchar.h(288) : error C2373: '__restrict__' : redefinition; different type modifiers
1> C:\mingw\include\wchar.h(287) : see declaration of '__restrict__'
1>C:\mingw\include\wchar.h(289) : error C2373: '__restrict__' : redefinition; different type modifiers
1> C:\mingw\include\wchar.h(289) : see declaration of '__restrict__'
1>C:\mingw\include\wchar.h(290) : error C2371: '__restrict__' : redefinition; different basic types
1> C:\mingw\include\wchar.h(289) : see declaration of '__restrict__'
1>C:\mingw\include\wchar.h(291) : error C2040: '__restrict__' : 'const char **' differs in levels of indirection from 'wchar_t *'
1>C:\mingw\include\wchar.h(292) : error C2371: '__restrict__' : redefinition; different basic types
1> C:\mingw\include\wchar.h(291) : see declaration of '__restrict__'
1>C:\mingw\include\wchar.h(294) : error C2371: '__restrict__' : redefinition; different basic types
1> C:\mingw\include\wchar.h(293) : see declaration of '__restrict__'
1>C:\mingw\include\wchar.h(295) : error C2040: '__restrict__' : 'const wchar_t **' differs in levels of indirection from 'char *'
1>C:\mingw\include\wchar.h(296) : error C2371: '__restrict__' : redefinition; different basic types
1> C:\mingw\include\wchar.h(295) : see declaration of '__restrict__'
1>C:\mingw\include\wchar.h(313) : error C2373: '__restrict__' : redefinition; different type modifiers
1> C:\mingw\include\wchar.h(312) : see declaration of '__restrict__'
1>C:\mingw\include\wchar.h(317) : error C2373: '__restrict__' : redefinition; different type modifiers
1> C:\mingw\include\wchar.h(316) : see declaration of '__restrict__'
1>C:\mingw\include\wchar.h(319) : error C2373: '__restrict__' : redefinition; different type modifiers
1> C:\mingw\include\wchar.h(318) : see declaration of '__restrict__'
1>C:\mingw\include\math.h(361) : error C2143: syntax error : missing ')' before ':'
1>C:\mingw\include\math.h(361) : error C2059: syntax error : ')'
1>C:\mingw\include\math.h(361) : error C3861: '__asm__': identifier not found
1>C:\mingw\include\math.h(387) : error C2143: syntax error : missing ')' before ':'
1>C:\mingw\include\math.h(387) : error C2059: syntax error : ')'
1>C:\mingw\include\math.h(386) : error C3861: '__asm__': identifier not found

What do they mean?

me7
30th January 2010, 14:01
if you want an anally correct CFR framerate use --fps.

Thanks for you informative post. This fix is a lot easier then messing with MinGW, I just didn't see the forrest for the trees. I'll be using --fps instead - it's safer then using MinGW tutorials I don't fully understand.
:thanks:

Abradoks
30th January 2010, 14:48
c:\mingw\1.0\local\include\zconf.h(289) : fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory
So, have you looked at that line?
Just include headers from zlib source folder (not those modified by configure) before your "C:\mingw\1.0\local\include". Actually, you don't need any mingw headers, only msinttypes, ffmpeg, bzip, zlib and atl.

TheFluff
30th January 2010, 15:41
BTW is --enable-runtime-cpudetect (which is widely used) currently working? I mean, does it automatically detect best cpu flags or does it use general C code if nobody specified sws_flags?
It's not used for swscale or postproc, only for lavc/lavf, and there it works, afaik.

Does that UTF-8 patch make any difference for Avisynth dll?
Yes, because it makes ffms2 assume all strings passed to its file opening functions are UTF8 instead of the local charset, so it'll most likely break things when it tries to convert anything outside the standard 0-127 ascii range to widechars, because it'll be assuming the input it UTF8.

Remove msvc_autoconf.bat from prebuild events (because it never works) and edit src/config/msvc-config.h manually if needed (config.h was renamed into msvc-config.h, but neither msvc project nor batch file was changed).
What do you mean "never works"? It should always work if you have the lib paths right. The renaming didn't actually break anything (except you couldn't open msvc-config.h from visual studio), but I've fixed it in those two places anyway.

By the way, if you're using msys, I sure hope you're building all your stuff in it with --prefix=/mingw.

I compiled zlib and ffmpeg without problems throught msys/mingw(4.4.1). All the header file are in "C:\mingw\1.0\local\include" and all the lib files are in "C:\mingw\1.0\local\include\lib"

I seriously doubt your lib files are in local/include/lib. Check that path again and see if libavformat.a is really there (that's what msvc_autoconf.bat looks for). Overall your msys (I assume you're using it) installation seems pretty screwy. Assuming you install it in C:/msys, msys-only things will be in C:/msys/1.0, while the actual mingw stuff will be in C:/msys/1.0/mingw. Everything you build should be built with --prefix=/mingw. Putting things into C:/msys/1.0/local seems like an extremely bad idea.

In general, getting mingw to work right and finding versions of the standard tools that actually aren't miscompiled is a gigantic pain in the butt. I suggest you follow this guide (http://www.cccp-project.net/wiki/index.php?title=Installing_MSYS-MinGW), or better yet just download the prepackaged environment linked on that same page, unless you really enjoy fighting with autotools for hours at an end.

Also, I'm not sure if setting the include paths in the project file is enough to get msvc-autoconf.bat to pick them up; I've never tried it myself.

SledgeHammer_999
30th January 2010, 16:55
Well I just finished building ffms finally.
I had to put in Linker->General these additional paths:
C:\mingw\lib
C:\mingw\lib\gcc\mingw32\<version number>

@TheFluff
To tell you the truth my mingw/msys install was sitting on my disk for more than 2 years(untouched). I mainly do my compiles under linux. If remember correctly I had pointed msys to install inside mingw program folder and then I used "fstab" to mount "mingw/". Today I dropped gcc-4.4.1 from tdragon in there. The libs are in the path I said, because I didn't know I should pass --prefix=/mingw in configure.

As I said ffms2 was built. But I am getting the same bug as previously although it doesn't appear when I encode the file using x264(via ffms).

Abradoks
30th January 2010, 17:28
It's not used for swscale or postproc, only for lavc/lavf, and there it works, afaik.
I'm asking because of that (http://ffmpeg.arrozcru.org/forum/viewtopic.php?f=1&t=1185#p3912) post:
--enable-runtime-cpudetect will compile in all optimizations in swscale. That way you have to specify what optimization you want to use in sws_flags (in the command line through -sws_flags mmx or mmx2, amd3dnow I don't remember).

It doesn't work as expected yet (actually choose the best flag) and it's my job to fix that. I'll only work on it after December though...
Yes, because it makes ffms2 assume all strings passed to its file opening functions are UTF8 instead of the local charset, so it'll most likely break things when it tries to convert anything outside the standard 0-127 ascii range to widechars, because it'll be assuming the input it UTF8.
So you don't use ffms2.dll with UTF-8 support inside Avisynth, right?

By the way, if you're using msys, I sure hope you're building all your stuff in it with --prefix=/mingw.
I don't want install everything into mingw dir, so I'm using --prefix=/home/custom_dir.

In general, getting mingw to work right and finding versions of the standard tools that actually aren't miscompiled is a gigantic pain in the butt.
Well, I haven't any troubles building x264 or ffmpeg with mingw tools. The biggest pain was actually building FFMS first time.

Also, I'm not sure if setting the include paths in the project file is enough to get msvc-autoconf.bat to pick them up;
Yeah, that's why it never works for me. It uses %LIB% when trying to find libavformat.a, but it's obviously not there.

TheFluff
30th January 2010, 17:38
So you don't use ffms2.dll with UTF-8 support inside Avisynth, right?

Correct, I'm only using it with Aegisub.

rack04
1st February 2010, 15:27
Is anyone able to download the latest svn from Google? I think the server may be having trouble.

Abradoks
1st February 2010, 15:53
Is anyone able to download the latest svn from Google? I think the server may be having trouble.
Works for me.

rack04
1st February 2010, 15:57
Works for me.

svn checkout http://ffmpegsource.googlecode.com/svn/trunk/ ffmpegsource-src

I keep getting "could not connect to server".

Abradoks
1st February 2010, 16:20
I keep getting "could not connect to server".
Here is r275 (http://rghost.ru/920192).

rack04
1st February 2010, 16:52
Here is r275 (http://rghost.ru/920192).

It's working now. Thanks.

KCE
7th February 2010, 03:41
Hey everyone, while using my Windows Vista 64 machine, I keep getting the following error on repeated loads(doesn't happen on the first load): "FFAudioSource: Audio track contains no audio frames". When the error occurs, the only way to fix the problem is by deleting the index file. It doesn't happen every time I open a script, but it happens very frequently. This only occurs on my computer that has Vista 64 and not either of my Windows XP 32 or Windows 7 64 PCs, so I'm guessing it is either a conflict with Vista, or more likely, some issue on this particular machine. Does anyone have an idea of what could be causing this?

Yeah, I have a similar problem but I'm on XP. When I use FFAudioSource I get that error unless I do FFIndex with overwrite, which is a pain in the ass since it has to rebuild the index multiple times...

TheFluff
8th February 2010, 00:08
Yeah, I have a similar problem but I'm on XP. When I use FFAudioSource I get that error unless I do FFIndex with overwrite, which is a pain in the ass since it has to rebuild the index multiple times...

post the entire file loading section of a script that produces such an error, please, and I'll look into it

Dogway
10th February 2010, 01:41
Can I with this plugin make the mp4 frame seek forward on mpc? My source is a variable framerate mp4. Can I keep that in output? I read the documentation, but didnt understand much. Actually Im trying with this code, which outputs a low constant framerate, with no forward seeking:

loadplugin("C:\Archivos de programa\AviSynth 2.5\plugins\ffms2.dll")
FFIndex("source.mp4", indexmask=7, dumpmask=0, overwrite=true)
FFVideoSource("source.mp4",cache=true,seekmode=1,cachefile="test.ffcache")

aegisofrime
12th February 2010, 09:57
Does anyone have the latest FFMS2 (281 I think?) compiled and ready for download? :thanks:

blazerqb11
12th February 2010, 21:43
post the entire file loading section of a script that produces such an error, please, and I'll look into it

Next time I have the error I will post the loading section, but the thing is that it doesn't happen every time. In fact if I moved the same script to a different computer it would be unlikely to happen. Generally it just looks something like:

video = FFVideoSource("video.mkv")

audio = FFAudioSource("video.mkv")

AudioDub(video, audio)

However, it occurs very often when I have several such scripts and another script that imports them:

Imports("script1.avs") ++ Imports("script2.avs") ++ Imports("script3.avs") ...

It is nearly impossible to load a script on that particular computer with 6 or more imports.

TheFluff
12th February 2010, 22:39
load audio first, that will prevent a pointless reindexing

I guess it might be some kind of problem where it doesn't realize that it needs to reindex with the audio, but I have no idea why it only happens on some computers. It sounds incredibly annoying to debug.

TheFluff
13th February 2010, 00:30
Double posting to say 2.13's been released. Myrsloik is busy but told me to release it for him.

Changelog:
2.13

Fixed a bug where the Avisynth plugin would drop the last frame when converting to CFR (lanwcp)
The Avisynth plugin will now attempt to detect and use NTSC fractional framerates for CFR files if applicable, instead of reporting something based on the average framerate (astrange, TheFluff)
The errorhandling parameter to FFIndex() will now actually do what the documentation claims it does (TheFluff)
Fixed a progress reporting crash when opening images (TheFluff)
Replaced the CMake build system with an autotools one that hopefully works better (Kovensky)
Fixed various compilation issues with MinGW (TheFluff)
Fixed h264 in mkv which was remuxed from bd sources, there are no longer decoding artifacts after seeking
Use pts instead of dts for seeking with lavf, fixes various timecode problems on mp4 files with certain obscure delay headers
Now compresses the index files with zlib to save space
Removed the boost dependency
Fixed the framerate calculation for AVC video in the RFF modes
Improved/fixed the NVOP detection in MPEG4 and how timestamps are calculated (lanwcp, Myrsloik)
Fixed an issue where the first 15 audio frames would never be redecoded if needed again
Fixed/added support for uncompressed video and audio formats in matroska, fixes Blank.Clip.720p.x264-darkhold.mkv (Emess)
The indexer and test is now statically linked so no extra runtimes are needed
FFmpeg is now compiled with runtime cpu detection, allows opterons and old cpus to work properly
Updated FFmpeg to rev 21782


libfaad is compiled in as usual but I didn't bother with opencore-amr because I seriously don't give a **** and I have no idea who else does either. Nobody seems to complain about it at least.

Download: http://ffmpegsource.googlecode.com/files/ffms2-2.13.7z
Source code: http://ffmpegsource.googlecode.com/files/ffms2-2.13_src.7z

The API docs have been updated as well.

LoRd_MuldeR
13th February 2010, 00:56
Hmm, I always get 0 frames with that build. I tried several AVI and MKV files, always the same result. Went back to the r257 test build and all is fine again.

Do I miss something ???

TheFluff
13th February 2010, 01:14
I'm not sure how I managed to not only link against the wrong version of ffmpeg but also fail to apply a five-line patch, but I sure succeeded at both. Reuploaded both archives, should work now.

LoRd_MuldeR
13th February 2010, 01:22
Much better :thanks:

Dogway
16th February 2010, 05:05
source="mysource.mp4"
FFIndex(source,cachefile = source + ".ffindex",audiofile = "%si%.%trackzn%.w64",errorhandling=1)
FFVideoSource(source,cache=true,seekmode=1,cachefile="source.ffindex")

I wonder if this code is OK. I get the index file with FFIndex, after that I comment it, and load it with FFVideoSource. Is this the proper way?

Do this routine use FFMS_MakeIndex or FFMS_DoIndexing?

Can't I just demux audio and mux it to indexed video? (Actually I can't index audio, I dont get the w64 file)

Whats the real benefit of this? For example in an avi or mp4? Can someone point me to any web to read more about this? Im not sure about what accurate frame seeking means.

burfadel
16th February 2010, 09:10
Thanks for the new version, its much appreciated!

jmartinr
16th February 2010, 14:07
load audio first, that will prevent a pointless reindexing

I guess it might be some kind of problem where it doesn't realize that it needs to reindex with the audio, but I have no idea why it only happens on some computers. It sounds incredibly annoying to debug.

I have the same problem on XP. Loading audio first doesn't help. Deleting the index file between 1st and 2nd pass helps.

The surprising part is: I've got 7 similar DV files. One file doesn't give poblems, the others do. So it's reproducable. I'll try later on an other computer.

TheFluff
16th February 2010, 15:06
I wonder if this code is OK. I get the index file with FFIndex, after that I comment it, and load it with FFVideoSource. Is this the proper way?
Yes, that looks OK.

Do this routine use FFMS_MakeIndex or FFMS_DoIndexing?
I don't remember, but it doesn't really matter because FFMS_MakeIndex just calls FFMS_DoIndexing. Why do you ask?

Can't I just demux audio and mux it to indexed video? (Actually I can't index audio, I dont get the w64 file)
No, ffms2 doesn't do demuxing.
What error message do you get?

Whats the real benefit of this? For example in an avi or mp4? Can someone point me to any web to read more about this? Im not sure about what accurate frame seeking means.
For AVI there isn't really any point in using this instead of AviSource. For other stuff you get the advantage of knowing that when you're looking at frame number X you know it really IS frame number X and not frame number X +/- 1. You can also demux timecodes and it supports VFR properly.

TheFluff
16th February 2010, 15:33
I have the same problem on XP. Loading audio first doesn't help. Deleting the index file between 1st and 2nd pass helps.

The surprising part is: I've got 7 similar DV files. One file doesn't give poblems, the others do. So it's reproducable. I'll try later on an other computer.

It would be very helpful if you could manage to produce a not too huge file that you can reproduce this error with.

Dogway
17th February 2010, 06:15
I don't remember, but it doesn't really matter because FFMS_MakeIndex just calls FFMS_DoIndexing. Why do you ask?


I just recall what the documentation said, that they were analog calls for the "simple" and the "hard" way. Just curious.

No, ffms2 doesn't do demuxing.
What error message do you get?


I dont get any error. I load the video with its audio muxed to FFIndex, so to expect 2 index files in output, video.ffindex and audio.w64. But I only see video.ffindex being generated. So my question was if its really as important to index audio...

Im having some troubles encoding with the usual ffmpegsource (the ffdshow). Can I just use FFmpegSource2 as a normal call on non VFR sources (no index, etc)?

Thanks a bunch for the help.

TheFluff
18th February 2010, 00:12
If you just call ffmpegsource2() it'll autogenerate the index as necessary (or you can set cache=false if you don't want it to save the index file, but then it'll have to reindex every time you open the script). If you want the w64 files you need to set the dumpmask parameter as appropriate (same thing applies if you use ffindex, missed that in my previous post). Setting just the audio filename isn't enough.

Also, the API documentation (that documents the difference between MakeIndex and DoIndexing) documents the Application Programming Interface and has very little to do with the Avisynth plugin. It's only useful for programmers who want to write their own non-avisynth-related stuff using the ffmpegsource internals.

jmartinr
21st February 2010, 00:07
@TheFluff, about this bug:

"FFAudioSource: Audio track contains no audio frames"

Removing the index file between runs helped for a few files, but not for all. I could reproduce it with the same file everytime. To pin things down I first simplified the script. A simple call was enough to trigger the error.
file="C:\TEMP\Bas.avi"
A = FFAudioSource(file)
V = FFVideoSource(file)
AudioDubEx(V, A)

Then I started to simplify the batch script that I use. Small differences could make that the error didn't occur. Wierd... Then I generated a very small AVI-file with the same name I used for testing. It generated the error. But... renaming the Avisynth file was enough to make that the error didn't occur.

So the batch environment used had the biggest influence. Every script did open normally in Virtualdub. You can find the files used at: http://www.roelofs-coaching.nl/downloads/Bas.zip

Blue_MiSfit
22nd February 2010, 15:54
Quick question - awhile back someone was regularly making builds with ffmpeg-mt. Do the standard ffms2 builds come with ffmpeg-mt? If not, is someone making builds with this?

Also, is there any reason to NOT use ffmpeg-mt? The speedup for H.264 decoding (among other things) is quite spectacular, as we all know :)

~MiSfit