View Full Version : FFmpegSource
TheFluff
8th October 2010, 12:33
Is anyone monitoring the bug tracker on the project's page?
Yes, I am, but I don't have a lot of time to maintain ffms2, unfortunately, so the maintaining mostly consists of applying Plorkyeran's patches. Even if I did have the time, I'm not actually a very good C++ programmer so it wouldn't help that much anyway.
Myrsloik
8th October 2010, 13:20
It's monitored just as much as this thread. Unfortunately none of us have much time right now. Please come back in a year and hope that I'm unemployed.
SledgeHammer_999
8th October 2010, 13:57
I hope in a year you will be still employed with higher wage and ffms2 has found additional programmers.
I am refering to issue 28.
henryho_hk
3rd November 2010, 17:14
It seems ffmpegsource-2.14 binaries in GoogleCode are not compiled with postproc library
TheFluff
4th November 2010, 10:44
It seems ffmpegsource-2.14 binaries in GoogleCode are not compiled with postproc library
Which binaries?
Gavino
7th November 2010, 12:20
In the FFInfo() function (from ffms2.avsi), there is a slight inaccuracy in displaying the CFR time - it truncates instead of rounding to get milliseconds.
Here's a revised version - I've also tidied up the code to get rid of the yucky global variable. :)
function FFInfo(clip c, bool "framenum", bool "frametype", bool "cfrtime", bool "vfrtime") {
framenum = default(framenum,true)
frametype = default(frametype,true)
cfrtime = default(cfrtime,true)
vfrtime = default(vfrtime,true)
c.frameevaluate(""" fftempstring = "" """)
framenum ? frameevaluate("""fftempstring = fftempstring + "Frame Number: " + string(current_frame) + " of " + string(framecount()) + "\n" """, after_frame=true) : nop()
frametype ? frameevaluate("""fftempstring = fftempstring + "Picture Type: " + chr(FFPICT_TYPE) + "\n" """, after_frame=true) : nop()
cfrtime ? frameevaluate("""fftempstring = fftempstring + "CFR Time: " + FFFormatTime(round((current_frame * 1000) / framerate())) + "\n" """, after_frame=true) : nop()
vfrtime ? frameevaluate("""fftempstring = fftempstring + "VFR Time: " + FFFormatTime(FFVFR_TIME) + "\n" """, after_frame=true) : nop()
return scriptclip("subtitle(fftempstring, lsp = 1)", after_frame=true)
}
Incidentally, ffms2.avsi is missing from the 2.14 download. Is this an oversight?
elguaxo
7th November 2010, 14:56
Thanks Gavino. :)
TheFluff
7th November 2010, 18:55
In the FFInfo() function (from ffms2.avsi), there is a slight inaccuracy in displaying the CFR time - it truncates instead of rounding to get milliseconds.
Here's a revised version - I've also tidied up the code to get rid of the yucky global variable. :)
function FFInfo(clip c, bool "framenum", bool "frametype", bool "cfrtime", bool "vfrtime") {
framenum = default(framenum,true)
frametype = default(frametype,true)
cfrtime = default(cfrtime,true)
vfrtime = default(vfrtime,true)
c.frameevaluate(""" fftempstring = "" """)
framenum ? frameevaluate("""fftempstring = fftempstring + "Frame Number: " + string(current_frame) + " of " + string(framecount()) + "\n" """, after_frame=true) : nop()
frametype ? frameevaluate("""fftempstring = fftempstring + "Picture Type: " + chr(FFPICT_TYPE) + "\n" """, after_frame=true) : nop()
cfrtime ? frameevaluate("""fftempstring = fftempstring + "CFR Time: " + FFFormatTime(round((current_frame * 1000) / framerate())) + "\n" """, after_frame=true) : nop()
vfrtime ? frameevaluate("""fftempstring = fftempstring + "VFR Time: " + FFFormatTime(FFVFR_TIME) + "\n" """, after_frame=true) : nop()
return scriptclip("subtitle(fftempstring, lsp = 1)", after_frame=true)
}
Incidentally, ffms2.avsi is missing from the 2.14 download. Is this an oversight?
Yeah, that's a miss by me. Committed your fix, thanks for the patch!
TheFluff
7th November 2010, 22:54
http://mod16.org/ffms2/ffms2-r354-unicodetest.7z
Hereby announcing the world's first Avisynth plugin with Unicode support.
Instructions:
FFVideoSource("filename with funny unicode characters you don't have in your default codepage.mkv", utf8="I swear by the Almighty BlankClip() that the Avisynth Script I will use shall be in UTF-8, only in UTF-8 and nothing but UTF-8.")
Save script as UTF-8 WITHOUT BOM
???
Profit!
Note that the argument to the utf8 parameter is case sensitive.
Also note that this feature is experimental; its semantics and/or existence may change without notice.
Also also note that ffmsindex.exe doesn't support Unicode. Yet.
burfadel
9th November 2010, 20:16
I've noticed in that ffms2 folder there's a single file called ffms2.dll that is much smaller than the one included in the r354 unicoderest (but its also from the same date). Does this rely on an external ffmpeg source?
TheFluff
9th November 2010, 20:50
I've noticed in that ffms2 folder there's a single file called ffms2.dll that is much smaller than the one included in the r354 unicoderest (but its also from the same date). Does this rely on an external ffmpeg source?
No, that's just an aborted upload. I'll delete it. There is a lot of other old junk in that folder, too. I should probably clean it.
jase99
10th November 2010, 02:17
Hi, I am having a problem loading some m2v files using v2.13 and v2.14. v2.12 is ok. Thought I would post here to mention I've logged details and provided a sample here:
http://code.google.com/p/ffmpegsource/issues/detail?id=32
henryho_hk
10th November 2010, 06:48
http://mod16.org/ffms2/ffms2-r354-unicodetest.7z
FFVideoSource
What about ffaudiosource()?
TheFluff
10th November 2010, 11:27
What about ffaudiosource()?
Should work in the same way, as should FFIndex().
SilaSurfer
13th November 2010, 17:42
Hello. I have a problem, maybe somebody could help me out. Ffmpegsource2 2.14mt and non mt version are giving me kind of "deadlocks", it stops responding in VirtualDub when seeking. I have put the ffms2.dll in system32 folder. Source is a Bluray which was remuxed into mkv with gsdmux from haali media splitter instalation package.
FFVideoSource("D:\Encoding\00000.track_4113.mkv", cache=true, cachefile="D:\system\00000.track_4113.mkv.ffindex")
It opens fine but when seeking and encoding it will just stop responding. Thanks
TheFluff
13th November 2010, 20:58
Hello. I have a problem, maybe somebody could help me out. Ffmpegsource2 2.14mt and non mt version are giving me kind of "deadlocks", it stops responding in VirtualDub when seeking. I have put the ffms2.dll in system32 folder. Source is a Bluray which was remuxed into mkv with gsdmux from haali media splitter instalation package.
Why would you put ffms2.dll in system32?
Also, provide a sample file.
WILLIS
14th November 2010, 05:55
hey im using FFMS2 for the first time and im having some difficulties...
im trying to load an avi with this
FFVideoSource("video.avi", int threads=2, int width=640, int height=272, string resizer="SPLINE", string colorspace="YV12")
and as a result i am getting
http://i52.tinypic.com/116j0ch.jpg
any ideas what im doing wrong? im sure its something simple...thanks!
sneaker_ger
14th November 2010, 07:02
Use
FFVideoSource("video.avi", threads=2, width=640, height=272, resizer="SPLINE", colorspace="YV12")
In case you don't know: most of these parameters are optional, so if you don't want to do any resizing you can also simply use:
FFVideoSource("video.avi")
SilaSurfer
14th November 2010, 18:10
Hey Thanks guys for your response. Last night Windows crashed on me, so I spend the whole day doing a fresh install. I tried it again and now it works. I don't know what was the reason for the issue, maybe the old windows installation. Thanks
yup
16th November 2010, 08:17
Hi all!
please advice how i can use mt version FFMpegSource
A = FFAudioSource(X)
V = FFVideoSource(X)
AudioDub(V, A)
SetMTMode(2,4)
filter()
or
SetMTMode(5,4)
A = FFAudioSource(X)
V = FFVideoSource(X)
AudioDub(V, A)
SetMTMode(2,4)
filter()
With kind regards yup.
Gavino
17th November 2010, 12:36
As I understand it, FFVideoSource sets the framerate to a value calculated from the duration of the first frame (except for MKV files, where it uses the average frame duration).
In principle, this should give the correct rate for CFR sources. However, in the case of FLV files, where timestamps have only millisecond accuracy, the calculated framerate can be out by enough to cause audio sync problems. For example, if the correct rate is 30fps, the first frame will appear to be 33ms long (instead of 33.333...), giving a frame rate of 30.303fps, an error of ~1%. Similar problems arise with 29.97, 24 and 23.976fps sources (there is no problem with 25fps, since frame duration is exactly 40ms).
Sure, you can manually add AssumeFPS() to your script, but you have to discover the correct framerate yourself by other means.
Would it not be possible for FFVideoSource to use the average frame duration for these sources too?
In the meantime, I have devised a workaround you can use in your script:
# Set frame rate from average frame duration, assuming CFR - use after FFVideoSource()
# Useful for sources such as FLV which have only millisecond accuracy on timestamps
function FFAssumeCFR(clip c) {
cc = c.Crop(0, 0, 16, 2) # use small clip for efficiency
# get timestamps of first and last frames - use runtime function to force frame access
current_frame = 0
dummy = c.IsYUV() ? cc.AverageLuma() : cc.RGBDifference(BlankClip(cc))
ts1 = FFVFR_TIME
current_frame = c.frameCount-1
dummy = c.IsYUV() ? cc.AverageLuma() : cc.RGBDifference(BlankClip(cc))
ts2 = FFVFR_TIME
ts2 == ts1 ? c : c.AssumeFPS(current_frame*1000.0/(ts2-ts1))
}
If the underlying problem cannot (or will not) be fixed, perhaps this can be added to ffms2.avsi?
Myrsloik
17th November 2010, 12:44
If the underlying problem cannot (or will not) be fixed, perhaps this can be added to ffms2.avsi?
Sounds reasonable, I guess. Let's see what TheFluff can come up with...
TheFluff
17th November 2010, 12:56
Actually I think it should just use the average for everything.
ajp_anton
19th November 2010, 00:07
The binaries at http://code.google.com/p/ffmpegsource/downloads/list aren't compiled with postprocessing support. Is there a PP-enabled version somewhere?
TheFluff
19th November 2010, 11:39
Not currently, but thanks for reminding me I need to build one. I'll build it when I get home from work.
TheFluff
20th November 2010, 02:10
http://mod16.org/ffms2/ffms2-r362.7z
Built with 100% more libpostproc. Note that the syntax for enabling UTF8 support in the Avisynth plugin has changed to a more boring and mundane utf8=true.
Changelog since 2.14:
The Avisynth plugin now supports UTF8 filenames. (TheFluff)
The FFInfo() function (supplied by ffms2.avsi) will now round timestamps to nearest millisecond instead of truncating them. It's also been cleaned up in general and no longer relies on global variables. (Gavino)
Containers opened with libavformat will now report a framerate based on the average frame duration instead of the duration of the first frame, just like Matroska files and files opened with Haali's splitter do. Should fix CFR framerates being reported incorrectly in dumb containers like FLV. (TheFluff)
PC/TV luma range (16-235 versus 0-255) detection should now be a bit more reliable. (TheFluff)
burfadel
20th November 2010, 05:29
That build r362 doesn't seem to work... I'm using Staxrip, which now reports a framerate of 2145338.250 and length 0.00. Of course, that then throws out x264.
TheFluff
21st November 2010, 01:16
That's what I get for copypasting code without looking at it and posting releases without testing them. http://mod16.org/ffms2/ffms2-r363.7z should fix the problem.
kypec
6th December 2010, 20:25
Dear developers, is there any chance you could add Ut Video Codec 8.5.0 source (http://forum.doom9.org/showthread.php?p=1454896#post1454896) decoder support into FFMS? That way x264 would benefit from ability to directly import lossless AVI files encoded with UtVideo. Otherwise I suppose the only way to import such files is to use DirectShowSource() via Avisynth :(
Thanks for any reply, even the rejective one, much appreciated! :)
TheFluff
6th December 2010, 21:08
Dear developers, is there any chance you could add Ut Video Codec 8.5.0 source (http://forum.doom9.org/showthread.php?p=1454896#post1454896) decoder support into FFMS? That way x264 would benefit from ability to directly import lossless AVI files encoded with UtVideo. Otherwise I suppose the only way to import such files is to use DirectShowSource() via Avisynth :(
Thanks for any reply, even the rejective one, much appreciated! :)
You should ask the FFmpeg people, not us. FFMS doesn't have any video codecs of its own, it's just a wrapper around FFmpeg.
That said there's a VfW codec for UTVideo so it should work just fine with avisource().
Chikuzen
6th December 2010, 22:49
@kypic
FFMS use libavcodec for decoding. so, it is possible if libavcodec supports UtVideo.
but AFAIK, there is no person who is working at present for that.
If you don’t want to use AVISource or if your source is not RGB, then you should use not UtVideo but ffvhuff.
The compressibility of ffvhuff is almost equal to UtVideo. and, it may be as fast as UtVideo on decoding if you use mt version of ffms.
Alexander Strange (developper of ffmpeg-mt) enabled MultiThread decoding of ffvhuff.
If you don't believe this, then you should try Komisar's x264 build (http://komisar.gin.by/).
his x264 binary uses ffmpeg-mt for lavf/ffms input.
lintran
7th December 2010, 09:12
Hi,
Can i use FFMS2 to index mov file (h264/aac like apple trailers) with script like that
LoadPlugin("path\ffms2.dll")
FFVideoSource("path\xxx.mov",colorspace="YV12")
Or I'll have to remux mov to mp4 or mkv then use FFMS2?
Thank you so much.
kypec
7th December 2010, 12:04
@ TheFluff: I see, thanks for clarification.
@ Chikuzen: Well, I just wanted to avoid the necessary step of creating AVS (though the most simple one like you proposed) and feed my source file directly into x264. However, I just experimented with Lossless mode of x264 (--qp 0) and as it seems I won't be needing UtVideo after all. It certainly is good and fast codec but compressibility-wise it just can't compete with Lossless AVC which x264 is offering. I've posted my observations in separate thread (http://forum.doom9.org/showthread.php?t=158361).
TheFluff
7th December 2010, 13:43
Hi,
Can i use FFMS2 to index mov file (h264/aac like apple trailers) with script like that
LoadPlugin("path\ffms2.dll")
FFVideoSource("path\xxx.mov",colorspace="YV12")
Or I'll have to remux mov to mp4 or mkv then use FFMS2?
Thank you so much.
Newer .mov files with h264/aac are just MP4 in disguise so it should work just fine. Older .mov is a mystery.
lintran
7th December 2010, 14:17
Newer .mov files with h264/aac are just MP4 in disguise so it should work just fine. Older .mov is a mystery.
Thank you TheFluff!
Did you mean if mov files with h264/aac are "newer" mov and are just MP4 in disguise so i can use ffms2 to index them without any problem?
Otherwise, all mov files (not h264) are called "older" .mov?
TheFluff
7th December 2010, 16:29
There's no trivial way to tell the two apart, as far as I know. FFMS2 should work with both, and as long as they're h264/aac it should be just as reliable as with MP4. If they contain anything else it's anyone's guess as to how well it works. Most likely it'll open them but I have no idea if you can get frameaccurate seeking. In theory it should work but it depends on libavformat quirks.
lintran
7th December 2010, 17:33
There's no trivial way to tell the two apart, as far as I know. FFMS2 should work with both, and as long as they're h264/aac it should be just as reliable as with MP4. If they contain anything else it's anyone's guess as to how well it works. Most likely it'll open them but I have no idea if you can get frameaccurate seeking. In theory it should work but it depends on libavformat quirks.
Thank you. But when i use MEGUI File Indexer to index mov (h264/aac), i've got script like that
LoadPlugin("C:\Program Files\MeGUI\tools\ffms\ffms2.dll")
FFVideoSource("path/xxx.mov",colorspace="YV12")
Then enqueue it, i got msg Incorrect Colorspace from megui:
11827
I click Yes, and still got this msg:
11828
I've checked my .avs file with info() and it showed my video colourspace is YV12.
So i dont know how to fix this problem. I found some ppl got this error like me, but didnt see any solution to fix it.
Could you please tell me how to fix this problem?
Thanks very much
--------------------------------
PROBLEM SOLVED, i've update Megui to lastest build and everything is OK now.
Thank you all
lintran
7th December 2010, 20:39
Newer .mov files with h264/aac are just MP4 in disguise so it should work just fine.
Dear TheFluff!
How do i know it should work fine?
I mean: what does "work fine" mean? Does it mean when index by FFMS2 then load into avisynth, after that video and audio are in synchronous? If yes, so I just have to check video and audio are out of sync or not to know it "work fine" or not?
Thank you.
TheRyuu
8th December 2010, 10:55
ffms2-mt-r375.7z (http://ffmpegsource.googlecode.com/files/ffms2-mt-r375.7z)
Fixes a bug which would cause the index to be recreated every time (introduced r372), ffmpeg-mt flavor.
WILLIS
8th December 2010, 18:14
ffms2-mt-r375.7z (http://ffmpegsource.googlecode.com/files/ffms2-mt-r375.7z)
Fixes a bug which would cause the index to be recreated every time (introduced r372), ffmpeg-mt flavor.
Having some trouble reaching that dl link...is there an alternate link I can snatch the file from? thx
LoRd_MuldeR
9th December 2010, 01:20
Having some trouble reaching that dl link...is there an alternate link I can snatch the file from? thx
Here you go:
http://www.mediafire.com/file/ft6ek4e1e145b4f/ffms2-mt-r375.7z
lintran
9th December 2010, 18:26
ffms2-mt-r375.7z (http://ffmpegsource.googlecode.com/files/ffms2-mt-r375.7z)
Fixes a bug which would cause the index to be recreated every time (introduced r372), ffmpeg-mt flavor.
Is ffms2-mt-r375 newer or older than ffmpegsource-2.14-mt? Should I use r375 or 2.14?
Thank you.
7ekno
9th December 2010, 23:30
2.14 = release version, r375 designates SVN version ...
2.14 is a "stable" release, r375 is the most recent, but developmental build (so use with caution, noting any bugs you may find here) ...
When an SVN ("r" designation) version is determined to be "stable", then it will be released as 2.15 in due course (but of course the SVN builds can continue) ...
It's the way most OSS works (release version are stable, but lagging behind "SVN" version for trial features/updates/bug fixes) ....
So back to the question of which to use:
It's your choice!
Do you need something stable that works with almost everything, or do you need the featureset of the SVN, but are happy to risk crashing, macroblocking, bugs, etc (that you are happy to report to the devs) ...
7ek
PS just to clarify, not all SVN builds are tempermental, keep in mind the goal is to better the OSS code via "trial and error", so some SVN builds work flawlessly, some have issues ;)
lintran
10th December 2010, 09:23
2.14 = release version, r375 designates SVN version ...
2.14 is a "stable" release, r375 is the most recent, but developmental build (so use with caution, noting any bugs you may find here) ...
When an SVN ("r" designation) version is determined to be "stable", then it will be released as 2.15 in due course (but of course the SVN builds can continue) ...
It's the way most OSS works (release version are stable, but lagging behind "SVN" version for trial features/updates/bug fixes) ....
So back to the question of which to use:
It's your choice!
Do you need something stable that works with almost everything, or do you need the featureset of the SVN, but are happy to risk crashing, macroblocking, bugs, etc (that you are happy to report to the devs) ...
7ek
PS just to clarify, not all SVN builds are tempermental, keep in mind the goal is to better the OSS code via "trial and error", so some SVN builds work flawlessly, some have issues ;)
Thank you ^^, I've got it
TheRyuu
11th December 2010, 21:36
2.14 = release version, r375 designates SVN version ...
2.14 is a "stable" release, r375 is the most recent, but developmental build (so use with caution, noting any bugs you may find here) ...
When an SVN ("r" designation) version is determined to be "stable", then it will be released as 2.15 in due course (but of course the SVN builds can continue) ...
It's the way most OSS works (release version are stable, but lagging behind "SVN" version for trial features/updates/bug fixes) ....
So back to the question of which to use:
It's your choice!
Do you need something stable that works with almost everything, or do you need the featureset of the SVN, but are happy to risk crashing, macroblocking, bugs, etc (that you are happy to report to the devs) ...
7ek
PS just to clarify, not all SVN builds are tempermental, keep in mind the goal is to better the OSS code via "trial and error", so some SVN builds work flawlessly, some have issues ;)
I didn't want to make a build for 374 because it was 'unstable' in a sense there was regression introduced at r372. Generally I'll make builds that are probably 'stable'.
TheRyuu
12th December 2010, 02:18
ffms2-mt-r375-avs64-2.7z (http://ffmpegsource.googlecode.com/files/ffms2-mt-r375-avs64-2.7z)
No idea if it works, I don't use avs64.
Actually have the indexing fix. Forgot that avs64 was it's own branch.
Anyone who got the previous version please re-download this version.
TheRyuu
15th December 2010, 12:48
ffms2-mt-r376-x64.7z (http://ffmpegsource.googlecode.com/files/ffms2-mt-r376-x64.7z)
New experimental version of 64bit ffms2. This one is compiled with msvc instead of the avisynth c plugin way via mingw (so load it via normal LoadPlugin("ffms2.dll").
Note: Only works with vista+ (vista or greater) machines.
Edit: Build in above post is still recommended over this one, but feel free to test it if you want to.
kemuri-_9
16th December 2010, 01:20
apparently the above is using ramiro's fake pthreads wrapping the windows api,
and i already noticed several issues with it, so if there's weird crashes in this binary, it's not my problem.
TheRyuu
16th December 2010, 01:33
apparently the above is using ramiro's fake pthreads wrapping the windows api,
and i already noticed several issues with it, so if there's weird crashes in this binary, it's not my problem.
Indeed, one issue is it apparently doesn't release handles for threads.
Suppose it's more proof of concept then anything.
One that that would work correctly would be a vanilla ffmpeg build using w32threads (would have no pthreads issues since it doesn't use that). Wouldn't be as fast though :(.
Edit: The avs64 build which uses the avisynth c interface is still recommended over the build I posted two posts up due to some issues, but feel free to test it out if you want too.
TheFluff
8th January 2011, 21:50
http://mod16.org/ffms2/ffms2-r408.7z
Go test this. Plorkyeran rewrote most of the audio code from scratch, so it should actually be sample-accurate like it claims to be now, at least with most containers and codecs. Notable exceptions are AC3 and MP3 since their libavcodec decoders seem to be, well, broken. Some other changes as well.
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.