View Full Version : updating ffms2.dll
stephen22
26th December 2016, 14:57
I want to update this plugin because my current version (2.17) has problems with some mp4 files.
With the latest version (2.23) I get a choice of x86 or x64. (I'm not sure which is appropriate as I'm on Windows 7 Home x64, but Avisynth is in the x86 Program Files)
I'm unable to load either new plugin. With the x86 version I get error "not an Avisynth 2 C Plugin". With the x64 version I get "Unable to load C Plugin error 0xc1"
With the old 2.17 plugin it loads OK (but later gives me problems on running or saving: "CAVIstreamsynth: system exception - access violation at 0x6eda2ebc, reading from 0x48".)
Be grateful for any advice.
Avisynth 2.60 Mar 15 2015
ndjamena
26th December 2016, 15:31
If you want to decode mp4 files lsmashsource would be more appropriate.
You want the x86 plugin because that's the 32 bit one and last I bothered paying attention 64 bit support in AVISynth was lacking.
Windows version is irrelevant, what matters is the program that is calling AVISynth. 32 bit programs call 32 bit AVISynth, 64 bit programs call 64 bit AVISynth. Unless someone wants to correct me you should always use 32 bit programs to call AVISynth for any real filtering.
How are you loading ffms2? I just dropped the dll in the plugins folder and it's been working fine just by autoload.
What version of AVISynth are you using? Make sure you have the latest or use AVISynth+.
Groucho2004
26th December 2016, 16:00
How are you loading ffms2? I just dropped the dll in the plugins folder and it's been working fine just by autoload.
What version of AVISynth are you using? Make sure you have the latest or use AVISynth+.
Automatic loading of C-plugins only works with AVS+.
manolito
26th December 2016, 16:10
Automatic loading of C-plugins only works with AVS+.
Or using a dirty little trick (which is used by qyot27):
Put the file "ffms2.avsi" which comes with the qyot27 C-Plugin into your AviSynth\Plugins" folder additionally. The first line in the AVSI is LoadCPlugin("ffms2.dll").
Cheers
manolito
stephen22
26th December 2016, 16:28
If you want to decode mp4 files lsmashsource would me more appropriate.
Thanks that's very helpful and solves the problem.
Thanks for all your help guys. Actually I'm supplying the full path for plugin and avsi file, and using VD.
best wishes and seasons greetings
Groucho2004
26th December 2016, 18:23
The first line in the AVSI is LoadCPlugin("ffms2.dll").
I'd prefer something more elaborate:
avsplus = false
try{avsplus = InternalFunctionExists("autoloadplugins")}
catch(err){}
(avsplus == true) ? nop : loadcplugin("ffms2.dll")
This explicitly loads ffms2 only with "classic" Avisynth. Also, the boolean variable "avsplus" might come in handy in some scripts.
stephen22
28th December 2016, 13:19
Actually I'm still curious to know why neither version of the 2.23 plugin will load when the 2.17 version loads ok with an identical script.
manolito
28th December 2016, 15:17
This is because your older version 2.17 obviously is a C-Plugin which must be loaded with the command "LoadCPlugin()" while the new version 2.23 is a "normal" Plugin which gets loaded with "LoadPlugin()". Or it can be auto-loaded if you copy it into your "AviSynth\Plugins" folder.
Instead of using the official version 2.23 from GitHub you can also use the latest C-Plugin from this post:
https://forum.doom9.org/showthread.php?p=1783312#post1783312
It is also from Oct. 2016, so it should be just as current as the official version. And this C-Plugin should work with your old script without errors.
And for both plugins you need to use the 32-bit versions if your installed AviSynth is 32-bit.
Cheers
manolito
stephen22
29th December 2016, 13:21
Thanks manolito. Easy when you know how!
One more q. Anyone know why some mp4 files give different length video and audio? Up to 5% out. Both with ffvideosource and lsmash thingy. (Not difficult to fix, but tedious).
ndjamena
29th December 2016, 13:35
AVISynth "emulates" AVI files, and AVI files are all constant frame rate. Variable frame rate files will be converted to just having a frame count and all the frames will have the same duration...
That's one of the problems, but not the only one. Really, all AVISynth filters do a bad job with "problem files" simply because there's no good way of handling them.
If a frame is unreadable or missing, what are they going to do about it?
Playback is easy, they can just skip them and carry on regardless. AVISynth has a specific frame count, and individual specific frames, and getting that out of some files isn't straight forward.
stephen22
29th December 2016, 17:46
Thanks, I understand - variable framerate. I find there's a distinct variability within the file making it difficult to sync the sound in all places.
best wishes!
sneaker_ger
29th December 2016, 18:44
I find there's a distinct variability within the file making it difficult to sync the sound in all places.
That's why it's called variable frame rate...
manolito
29th December 2016, 21:40
As it has been mentioned before, AviSynth does not understand VFR. So the source filter should convert VFR to CFR to avoid sync problems.
ffms2 can do this if you provide the fpsnum and fpsden parameters in the command line. This is from the manual:
##### int fpsnum = -1, int fpsden = 1
Controls the framerate of the output; used for VFR to CFR conversions.
If `fpsnum` is less than or equal to zero (the default), the output will contain the same frames that the input did, and the frame rate reported to Avisynth will be set based on the input clip's average frame duration.
If `fpsnum` is greater than zero, `FFVideoSource` will force a constant frame rate, expressed as a rational number where `fpsnum` is the numerator and `fpsden` is the denominator.
This may naturally cause `FFVideoSource` to drop or duplicate frames to achieve the desired frame rate, and the output is not guaranteed to have the same number of frames that the input did.
Cheers
manolito
stephen22
31st December 2016, 12:36
Thanks again. Hadn't studied the docs.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.