View Full Version : FFmpegSource
Myrsloik
16th June 2007, 22:12
This thread shall begin much like one of my previous (http://forum.doom9.org/showthread.php?t=98327) ones...
One day I got bored (again) and thought it would nice to have a plugin to open mkvs and similar things. That attempt failed miserably because it turns out that ffmpeg has just as much documentation as the average open source project.
But as you all know you can't let computers win. Ever.
This plugin should support decoding of all FFmpeg supported video formats with frame accurate seeking in avi, mkv and mp4 and possibly some others. Haali's parser is used for matroska since the ffmpeg one has serious issues and FFmpeg for everything else. Opening files is however a bit slow due to the required indexing.
All current downloads and the source can now be found at the Google code project. This also includes TheRyuu's most recent FFmpeg-mt compiles as well as the old 1.21 version. (list deprecated downloads to make it appear)
Google code project (http://code.google.com/p/ffmpegsource)
Full changelog (http://ffmpegsource.googlecode.com/svn/trunk/doc/ffms2-changelog.html)
Note: The real name is "Fabulous FM Source 2" and is in no way related to FFmpeg.
The future todo list (http://forum.doom9.org/showthread.php?p=1291484#post1291484). Feel free vote for the features you want or suggest your own.
Wilbert
16th June 2007, 22:40
That's cool stuff! I will try it out tomorrow!
foxyshadis
17th June 2007, 02:37
Very awesome. I might be able to skip DirectShowSource entirely now.
Seeking is broken on MPEG1 PS files, and when muxed into another container they just don't work at all. Well, I can continue using DGDecode on those. All other formats appear to work perfectly.
One concern I have is the naming of the support files. Obviously they can't be statically linked, being different compilers, but other software uses the same libs, but incompatible. (Mediacoder for one, probably others.) Would it be possible to add a prefix/suffix to them? Even better, use loadlibrary to load them from the plugin's folder (which is rarely the same as current working folder in avisynth)?
The listed improvements would be awesome, particularly timecodes. =D
Alain2
17th June 2007, 12:18
This plugin sounds interesting :)
As a matter of interest, is it handling variable framerate video and how ? (something similar to directShowSource(convertfps=true,fps=...) ?)
Myrsloik
17th June 2007, 13:14
Actually I'm considering making it a c interface plugin because then I could statically link everything with gcc.
With vfr it just returns every encoded frame and sets the fps to 30.
Kurtnoise
17th June 2007, 15:49
edit...wrong manip.
Kurtnoise
17th June 2007, 15:51
With vfr it just returns every encoded frame and sets the fps to 30.
Actually, it returns 30 fps even with my 25 fps raw materials (at least for me). What's wrong ?
Myrsloik
17th June 2007, 18:38
That should be fixed in the updated version. It used the duration from another unrelated place before which for some reason also was 30 fps.
Kurtnoise
19th June 2007, 08:27
Thanks for the new build.
btw, I've a request for the next releases : to be able to choose/select the video *or* audio tracks numbers.
Something like that :
FFmpegSource(string source, int vtrack = -1, int atrack = -1, bool forceseek = false, string timecodes)
where vtrack stands for video tracks and atrack for audio tracks of course.
tebasuna51
19th June 2007, 11:02
Thanks for the new build.
btw, I've a request for the next releases : to be able to choose/select the video *or* audio tracks numbers.
I'm also interested in ffmpeg like audio decoder, actually I can't get audio from FFmpegSource().
Maybe in a future release?
tranfa
20th June 2007, 00:27
Hi Myrsloik,
unfortunately I get a "Loadplugin: unable to load C:\Program files\AviSynth 2.5\plugins\FfmpegSource.dll" error....but apparently everything should be in order (plugins in the right place).
Do you have an idea on what I'm doing wrong?
foxyshadis
20th June 2007, 00:48
All of the support dlls have to be on the path, not in the same folder as the plugin. The simplest path is just putting them in the windows folder. (Or you can add the plugin folder to the windows path in the system control panel, but that might not be a great idea.)
AVIL
20th June 2007, 07:55
@tranfa
If you use Virtualdub to render the scripts, you can put the support dll's into Virtualdub's folder.
tranfa
20th June 2007, 21:14
Thank you foxyshadis, thank you AVIL: I put the dlls into windows/system32 directory, and everything works fine both with Avsp and Vdub.
By the way, thank you Myrsloik, great plugin.
Fizick
20th June 2007, 22:34
I am a little confused by this comment:
One concern I have is the naming of the support files. Obviously they can't be statically linked, being different compilers, but other software uses the same libs, but incompatible. (Mediacoder for one, probably others.)
Myrsloik do you complile this "support DLL" some special way or they are standard?
Myrsloik
21st June 2007, 00:10
They're completely standard. The included dlls were compiled with:
./configure --enable-shared --disable-static --enable-memalign-hack --enable-swscaler --enable-gpl --disable-encoders --disable-muxers
foxyshadis
21st June 2007, 07:59
It's the configure options that are different. Mediacoder uses a totally different set, since it enables encoders and muxers.
Actually, now that I went hunting, I can't figure out what's dependant on that older avformat-51.dll. I guess it's not that important, in that case. >.>
d'Oursse
21st June 2007, 08:21
Kurosu tried to write an ffmpeg source for avs3. He had a lot of problems with the audio. I can't remember what was the difficulty, though.
One thing to note about ffmpeg: the dev team never does any release and the api can change one day or another. So the plugin can, one day, not work anymore.
Myrsloik
21st June 2007, 15:44
I've looked a bit at the audio part now and everything seems to be the difficult part (unless you just want to play it linearly from one not too accurately specified point, then it's trivial).
The part about ffmpeg developers possibly changing the api one day is an exceptionally weak point if you look at how much has actually changed over the years. The sample I started with (unfortunately the only decent one in existence) from http://www.inb.uni-luebeck.de/~boehme/libavcodec_update.html which was written exactly 3 years ago can still be compiled by only changing 3 lines or so (and by adding a few explicit casts if you use a c++ compiler). The changes were only in the names of fields containing information about the streams and the replacements were easy to locate. There were no changes in the actual decoding logic and the library still contains all deprecated functions so older programs should work with the new version after a recompile. You might as well say that one day windows will change and avisynth won't work anymore...
What official releases have to do with it will remain a mystery...
d'Oursse
21st June 2007, 15:59
ask the gstreamer developpers about the different versions of ffmpeg. For a developper it's a pain. Example : 3 or 4 days ago : they changed the options of configure. It's not 3 years at all.
The interest of a release : When compiling a program, you can check a specific version of the release. Then you know what the api is and use the correct functions, struct, etc... You might also know with a release if the abi is broken from a version to another, or not, which is also very important.
windows has already changed and some programs didn't work anymore. Even with different SP of XP some programs work or not.
akupenguin
21st June 2007, 21:01
ask the gstreamer developpers about the different versions of ffmpeg. For a developper it's a pain. Example : 3 or 4 days ago : they changed the options of configure. It's not 3 years at all.
That's the build system, not the api. It affects compiling ffmpeg, not compiling programs which use libav*, unless you imported a copy of ffmpeg into your source tree.
Incompatible api changes require incrementing the major version, which has happened twice in the last 3 years.
Myrsloik
22nd June 2007, 18:50
My attempt at a sample accurate audio source. Not very tested yet. Only supports mpeg1 layer 2/3 audio in mkv so far. Should seek accurately in the same formats as the video source.
Usage: FFAudioSource(string source, int track = -1)
Experimental audio source (http://ivtc.org/new/beta/FFAudioSource.dll)
ficofico
23rd June 2007, 12:06
I've tried to make a script including this line
(mvfpsflowscd(30,oversample=16,blurradius=4)
but when I open the file with FFMpegSource avisynth give me an error
http://ficofico.interfree.it/errore.JPG
Where I've to write "linear=false" ?
IanB
23rd June 2007, 14:37
ChangeFPS(...., linear=False)And it will be on line 10 of one of your *.AVSI files.
Also oversample=8 might probably avoid the issue as well.
Mr_Odwin
28th June 2007, 22:37
What there is of this so far is great. I used it today on an flv file and the video part seemed to work fine, even though flv isn't mentioned in the readme.
Myrsloik
2nd July 2007, 23:47
A new version has been released with several improvements to seeking.
FLV files have now been confirmed to work perfectly
VOB files now appear to have frame accurate seeking (at least with the single test vob used) but no rff flags applied (won't ever happen)
Normal MPG files should seek without showing artifacts
Feel free to report the results with any other containers you use.
VOB files now appear to have frame accurate seeking (at least with the single test vob used) but no rff flags applied (won't ever happen)
Wouldn't applying rff flags be a must for proper IVTCing of badly flagged video? (Looking at that URL in your sig I'm rather surprised to read the above... :))
np: Lusine - Flat (Cepia Remix) (Podgelism)
Myrsloik
3rd July 2007, 00:04
Doing that using only libraries coming from ffmpeg you have to first decode the video to find out the flags. So in the end all you'd get is a very slow dgindex/dgdecode clone if you're lucky. I don't see a great demand for that.
If you find me a nice mpeg/vob/ts parsing library it would be a completely different thing though...
infernix
4th July 2007, 23:25
works on wine! tried only on demuxed .vc1 source so far:
FFmpegSource(source="FEATURE_1_FEATURE_2.VC-1.stream.0.vc1",track=-1,seekmode=0,timecodes="test.timecodes",cache=true,cachefile="test.ffcache")
AssumeFPS(23.976)
takes a minute or two to index for 18GB. And I can't seek, or it takes incredibly long (probably the latter).
Thanks so much :) i hate the VFW interface, I couldn't get it to read vc1 :)
Myrsloik
13th July 2007, 07:18
Version 1.3 has been released (see first post) and some other items have been added to the possible improvements list.
ficofico
13th July 2007, 17:21
Myrsloik can you post the version 1.1? This version doesn't work in my batch script.
With the tool avs2avi, the avs file is like: ffmpegsource("temp.mp4) when temp.mp4 it's a x264 8000 bitrate .The conversion in xvid with avs2avi with the 1.1 release it's good, with this version doen't work, it give me error.
The dll in plugins directory it's still 1.1 (after I've seen that 1.3 doesn't work) but the dll in system32 are from 1.3 version.
thanks
Myrsloik
13th July 2007, 19:02
No, if you can't be bothered to actually tell me what the error is it can't be that important.
ficofico
13th July 2007, 19:51
the error it's
http://ficofico.interfree.it/errore1.jpg
the script it's very simple
http://ficofico.interfree.it/errore2.jpg
Before upgrade ffmpeg works well.
Harukalover
13th July 2007, 20:47
ficofico: Hint: Read the manual when upgrading to newer versions.
There is no function named ffmpegsource anymore.
/me points to ffvideosource
ficofico
13th July 2007, 21:07
ops..................sorry, but I've assume that the name was a constant.
Myrsloik
13th July 2007, 21:07
My guess is that you're using the ffmpeg dlls from a previous version/other program.
ficofico
13th July 2007, 21:47
no no, now I've upgrade the dll and change the script, now work. Thank you and sorry for the mistake.
Myrsloik
16th July 2007, 15:29
It's time to get some input from the silent masses...
What should I do about audio handling in general?
Is there any reason at all to keep FFAudioSource when FFAudioRefSource actually works (if you've got the space)?
Should FFAudioRefSource be merged with FFVideoSource (faster file opening the first time if you want both audio and video)?
Should I waste many more hours to try to get FFAudioSource to work (it's highly unlikely it'll ever be good for more than previews)?
...the next version will also have postprocessing.
Mr_Odwin
16th July 2007, 17:20
I personally would like FFVideo and FFAudio/FFAudioRef merged; perhaps like QTInput/Directshowsource where there is an audio=true/false option?
IanB
17th July 2007, 01:17
From a user perspective it is much more straight forward to them if you do the AudioDub of the audio and video internally for them.
From a programming perspective I know it sucks having function arguments left, right and centre to control need behaviour.
buzzqw
17th July 2007, 17:42
excellent :thanks: !
i have just build a beta of automkv that use yout ffmpegsource!
Excellent! now many users will be able to decode/process several kind of media (expecially when directshow source isn't so affidable)
just to know: is it a bug or know that framerate is always 30 ?
and ... using with autocrop plugin (that make arbitrary seek on file) will cause ffmpegsource to throw out an error (on mkv files)
thanks again, i would like to include your works in next release of AutoMKV, if you want
thanks!
BHH
Myrsloik
18th July 2007, 15:26
Yet another new version with big changes and probably some new bugs has been released...
The autocrop bug should be fixed and the framerate set to the average for mkv files.
Would there be any interest in a simple swscaler filter? It would allow combined resizing and colorspace conversions with some combinations possible that aren't available in avisynth by default (ever wanted to point resize the chroma when going between yuy2 and yv12?)
buzzqw
18th July 2007, 18:10
YES!
Autocrop is working, slow but working! THANKS!
and even the framerate is fixed!
Would there be any interest in a simple swscaler filter?
a resizer ?
imho ... no
i use your excellent plugin primary for loading file
then i use all avisynth internals/externals plugin for every other need
BUT i don't know so well avisynth so i cannot say if would be useful for some others..
one more think: one user have reported that after 50' and 14 sec the encoding is blocked.
It was feeding a 1280/640 x264+acc matroska file, using FFmpegSource 1.3
i haven't much more information, i will ask on my automkv thread
thanks again!
BHH
AVIL
20th July 2007, 12:28
Hi,
About this:
Future improvements if there's any interest:
Convert it to a c plugin (static linking, no additional dlls)
IMHO is preferable let things as is. Reason: the uderlying dll's could evolve even though the plugin remains unchanged or be discontinued.
Myrsloik
20th July 2007, 12:43
The source is available and without changes the binary is almost guaranteed to turn obsolete and unupgradable long before the source is with just a recompile.
MatMaul
21st July 2007, 19:58
I can't decode ac3 audio stream embedded in avi file, is it normal ? ("codec not found")
I think you haven't compile ffmpeg dlls with liba52 support.
Myrsloik
21st July 2007, 20:00
Did I ever claim to have compiled ffmpeg with any additional libraries?
buzzqw
21st July 2007, 20:03
well .. more library are inside.. more compatibility we have..
so i suggest to add additional library... if possible
thanks!
BHH
MatMaul
21st July 2007, 22:51
I suggest liba52 and libfaad2 then we can decode ac3 and aac streams which are very common.
tebasuna51
22nd July 2007, 01:00
At least with libfaad2 because don't exist a good dedicated aac decoder for AviSynth, actually we need use DirectShowSource.
For ac3 (and mpa, mp2, mp3) we can use NicAudio.dll also based in liba52.
For WAVE_FORMAT_EXTENSIBLE, ogg, flac, wma, ... we can use BassAudio.dll and Bass libraries + Add-Ons. BassAudioSource can decode stereo aac/mp4 but don't work for multichannel aac.
MatMaul
22nd July 2007, 13:54
At least with libfaad2 because don't exist a good dedicated aac decoder for AviSynth, actually we need use DirectShowSource.
For ac3 (and mpa, mp2, mp3) we can use NicAudio.dll also based in liba52.
For WAVE_FORMAT_EXTENSIBLE, ogg, flac, wma, ... we can use BassAudio.dll and Bass libraries + Add-Ons. BassAudioSource can decode stereo aac/mp4 but don't work for multichannel aac.
yes but with ffmpegsource we can do that without demux the avi or mkv and it is great :)
Lele-brz
26th July 2007, 10:40
Hi,
I switched to this amazing FFMpegSource for some of the video like mp4 container, I found it more reliable than DirecShowSource especially for x264 encoding.
Now I'd like to use it for a video with this specs:
container: flv, video: vp6f, audio: mp3
But it doesen't work, is it only a problem of libraries, since the latest ffplay can read it.
thanks in advance for any help
Bye
I suggest liba52 and libfaad2 then we can decode ac3 and aac streams which are very common.
I agree, that would be sweeeet.... :devil:
Susana
26th July 2007, 16:30
What's the problem with directshow-based ones? :confused:
Is there a size limit for the input file? When I tried earlier today it wouldn't accept a 8.5GB file but a smaller segment of the same file was ok.... ?
Myrsloik
26th July 2007, 21:51
It's probably limited to 4GB or so because of the fseek usage. It could probably be fixed for matroska but I have no idea what to do about libavformat.
It's probably limited to 4GB or so because of the fseek usage. It could probably be fixed for matroska but I have no idea what to do about libavformat.
What a shame, too bad it isn't an easy fix. At least now I know it won't work, thanks. :)
Lele-brz
27th July 2007, 10:39
I'm not sure the limit is 4Gb, I was able to encode a 5.15 Gb video using FFMpegSource
container: mov
video: dvvideo
audio: pcm_s16be
duration: 24:18
bitrate: 30.341 kbps
I'm not sure the limit is 4Gb, I was able to encode a 5.15 Gb video using FFMpegSource
container: mov
video: dvvideo
audio: pcm_s16be
duration: 24:18
bitrate: 30.341 kbps
Hmmm, that's odd. I'll have to try it on some more large files then. My input was a .mkv-file. I'll try the new AutoMKV as well... (and yes, the partition is NTFS :) )
Nope, tried a second 8GB file and I get the same error message...
FFMpegSource: Can't parse Matroska file: I/O Error: Invalid argument
I'm on Vista (32bit), maybe that's why... :-O
Myrsloik
28th July 2007, 17:58
New test compile that should fix the issues with huge mkv files and mpeg2 in mkv:
deleted
Note that it requires the dlls from the normal package and that it now uses the AVISYNTH_C interface. ONLY FOR TESTING.
video_magic
28th July 2007, 19:33
Hurrah for Myrsloik!!!! :thanks: Very useful and time-saving :)
New test compile that should fix the issues with huge mkv files and mpeg2 in mkv:
http://ivtc.org/new/beta/FFmpegSource.dll
Note that it requires the dlls from the normal package and that it now uses the AVISYNTH_C interface. ONLY FOR TESTING.
Nice! However, I get a message saying "ffmpegsource.dll is not an Avisynth 2.5 plugin"?
Myrsloik
29th July 2007, 18:49
That could be because it isn't one. As I wrote in the post, quoted by you for additional effect, it uses the the c interface. Load it with load_stdcall_plugin or loadcplugin.
buzzqw
29th July 2007, 18:57
would be possible to build with standard interface ? with loadplugin ? is more handy
thanks
BHH
Sorry 'bout that, I had no idea there was such a thing... :eek:
Now I get 'access violation' though, maybe I'm doing something wrong...
Myrsloik
29th July 2007, 22:53
Another updated version has been released that fixes lots of trivial typos in the code that have shown up through the versions and adds aac and ac3 decoding support to the included libavcodec.
The website is also hosted at a real webspace provider now so the download speeds should be much better.
The ffmpegsource.dll is still dated 07/18/2007 and says 'audio codec not found' when fed a source with ac3? Still v1.4? Other than that, can't wait to try the new one... :)
Myrsloik
29th July 2007, 23:54
No, it's the right one and it works here. Check the version number listed in the documentation if you think you've somehow gotten an older version.
Hmmm, that's weird.. now it's the correct version. Maybe I had it cached or something... thanks!
Can't get audio (ac3) to work in .mkv files, I just get silence. I also get a lot of messages when encoding that it's ignoring certain matroska headers. VOB seems to work and .avi with ac3 as well. Also, the audio cache gets pretty huge, is that normal?
Myrsloik
30th July 2007, 13:08
New version uploaded that should fix ac3 and some other audio formats in matroska.
It's normal that the audio cache is huge since the whole file is stored as raw pcm in it. It's also why audio isn't opened by default.
Wow, that was quick! I'm beginning to feel like a pain in the rear... ;) Makes sense about the audio, better than demuxing it myself anyway... cheers! :D
Now I get "System exception - Stack overflow" with .mkv... :eek:
Myrsloik
30th July 2007, 13:41
Exactly what does the mkv contain? Could you cut a piece of it and upload to ftp://upload:upload@mellbin.org ?
It contains just an AVC/H264 video stream and the AC3 stream...
Uploading a sample shortly...
Myrsloik
30th July 2007, 14:02
It works here. Did you try deleting all old cache files?
Yes, deleted all old cache files. I'll reboot my machine shortly too just in case...
What commandline did you use in your .avs?
Doh! It was only when playing the .avs in WMP11, MPC works fine...
Another problem (surprise).. now my wmcmd.vbs won't recognize the audio format, I guess that's because it's 6ch PCM and not 6ch WAV?
Edit: Ah, enabling ffdshow raw audio took care of the wmcmd.vbs problem... :)
foxyshadis
30th July 2007, 19:17
I don't have a problem with the audio cache, if random access methods are going to cause problems. But would it be possible to either pass each block through zlib first, or designate the file as compressed? (ie, by passing FILE_ATTRIBUTE_COMPRESSED to CreateFile.) Doesn't help much, but since disk i/o will be the big blocker there, it'll help some.
Leak
30th July 2007, 20:22
I don't have a problem with the audio cache, if random access methods are going to cause problems. But would it be possible to either pass each block through zlib first, or designate the file as compressed? (ie, by passing FILE_ATTRIBUTE_COMPRESSED to CreateFile.) Doesn't help much, but since disk i/o will be the big blocker there, it'll help some.
How about storing (rolling) checksums of, say, 4KB blocks of audio instead (like rsync does) so that you can start decoding at some approximate position in the compressed audio and figure out where you actually are after decoding at most 8kB minus one byte followed by adjusting accordingly? (i.e. seek back some more or decode a bit more until you hit the right sample)
That way you get sample-accurate seeks to each 4kB position while only having to store only a fraction of the current amount of data, with only a small performance hit after a seek.
np: Thomas Fehlmann - Atlas 2 (Honigpumpe)
Myrsloik
30th July 2007, 21:32
The following information could be very wrong since most of my observations come from comp.exe and not even a real hex editor...
The things I've tried so far is to index the audio in a way similar to the video, demuxing the raw audio stream to its own file to eliminate inaccurate seeking and the current method. Demuxing the audio to a separate file didn't make any real difference in decoding behavior in most cases.
Some kind of state does however seem to be kept by some decoders (mp3 which I mainly tested with) that means you won't get the same output even if you start at a much earlier point. Interestingly enough offset isn't what made me give up but the fact that the decoded samples seemed to be off by +-1 in a systematic way.
I could resurrect the most working version of the code as a separate filter if anyone wants to try their luck. Don't think anyone really commented on how it worked before it was removed.
I think I'll go read the flac documentation now...
smok3
14th August 2007, 12:38
all i ever get is: cant load ffmpegsource.dll..., what is there to do?
Leak
14th August 2007, 13:05
all i ever get is: cant load ffmpegsource.dll..., what is there to do?
Are you using LoadCPlugin to load it? (Note the extra "C" in there...)
smok3
14th August 2007, 13:11
yes, i have tried all possible things.
buzzqw
14th August 2007, 14:46
unzip ffmpegsource.zip in your \windows\system32, and overwrite all file
then take the ffmpegsource.dll and put where you want
load it with standard LoadPlugin
BHH
CruNcher
18th August 2007, 19:00
could it be that ffmpegsource is damaged ? i get this here after some encodes (1920x1080p 23.976 Film) of the same clip in the cmd
Compiler did not align stack variables. Libavcodec has been miscompiled
and may be very slow or crash. This is not a bug in libavcodec,
but in the compiler. Do not report crashes to FFmpeg developers.
System is AMD Athlon 64 Venice @ 2.4 Ghz Windows XP SP2
playbacking the .avs with mpc works fine tough but encoding results in output errors (strange blocks, luma changes)
Gusar
18th August 2007, 20:56
The bug is, as the message says, in the compiler. Only the recently released gcc-4.2 for MinGW compiles correct code, older MinGW compilers do not.
Myrsloik
18th August 2007, 21:17
Version 1.7 already is compiled with gcc 4.2.1 which I got from http://forum.doom9.org/showthread.php?p=1028402#post1028402 since
3.4.5 couldn't even link faad2 and a52dec properly. So there has to be more to it than just the compiler version.
Gusar
18th August 2007, 22:13
Version 1.7 already is compiled with gcc 4.2.1 which I got from http://forum.doom9.org/showthread.php?p=1028402#post1028402 since
3.4.5 couldn't even link faad2 and a52dec properly. So there has to be more to it than just the compiler version.Some MinGW fixes have been added to ffmpeg revision 10106 (Aug 13). If your build is older, that's the problem.
TheRyuu
18th August 2007, 22:27
Version 1.7 already is compiled with gcc 4.2.1 which I got from http://forum.doom9.org/showthread.php?p=1028402#post1028402 since
3.4.5 couldn't even link faad2 and a52dec properly. So there has to be more to it than just the compiler version.
Your right it is more then just the compiler.
The 3.4.x versions are the ones that break libavcodec, not to mention can't link those items properly.
The newer 4.2.x versions shouldn't break it.
This is based off of experience with libav with xbmc's mplayer.dll.
I suppose ffmpeg shouldn't be that much different.
could it be that ffmpegsource is damaged ? i get this here after some encodes (1920x1080p 23.976 Film) of the same clip in the cmd
System is AMD Athlon 64 Venice @ 2.4 Ghz Windows XP SP2
playbacking the .avs with mpc works fine tough but encoding results in output errors (strange blocks, luma changes)
It's normally a compiler error.
And it can break some decoding options in libavcodec.
Myrsloik
18th August 2007, 22:41
Try the new version and see what happens.
smok3
19th August 2007, 14:07
unzip ffmpegsource.zip in your \windows\system32, and overwrite all file
then take the ffmpegsource.dll and put where you want
load it with standard LoadPlugin
BHH
great, that did it, can i expect to get some aac audio throught this?
winnydows
20th August 2007, 00:05
Myrsloik
:thanks: for your plugin. I dream about it a lot of years. I add your plugin to my program:
XviD4PSP 5.000 beta 15 lite (http://winnydows.com/download/xvid4psp/XviD4PSP_5000_beta_15_lite.exe)
Framework 3.0 required.
One question:
How i can change audio track in your plugin ?
Best regards in your developing. You my Saviour.
Myrsloik
20th August 2007, 01:14
From The Book of Encoding chapter 5 verse 9:
atrack & vtrack: Track number as seen by the relevant demuxer, starts from 0, -1 means it will pick the first suitable track and -2 means it's disabled.
I've had some more time to figure out how to use flac for the audio cache and it seems possible with very little work since the library actually supports sample accurate seeking natively. There ara however a few implementation details I don't know what to do about...
Should it be possible to select between raw pcm and flac compression? There will be at least one added argument for flac's compression level anyway since there's a big difference in speed between them.
If yes, should the uncompressed cache be extended to write real wav files instead of just raw pcm? Would that improve anything for people who just want the audio decoded for processing with other programs?
Note that it should be easy to autodetect the cache type so it wouldn't cause any issues to implements all 3 (pcm/raw/flac) options.
CruNcher
21st August 2007, 07:26
@ Myrsloik
yep no more message no problems anymore thx :)
MatMaul
22nd August 2007, 15:38
hey !
first thanks for this great plugin.
do you think the support for mov files can be added please ?
I would like to open the video of my camera (mov file, mjpeg codec) with this plugin. My videos play fine with ffmpeg.exe
Myrsloik
22nd August 2007, 18:49
Upload the file or a part of it to ftp://upload:upload@mellbin.org/ and I'll take a look at it when I've got the time.
MatMaul
22nd August 2007, 20:24
done !
Myrsloik
22nd August 2007, 22:34
The bugs have been found and the file will work in the next version. The stack overflow was caused by av_find_stream_info() needing a really big stack. It is now executed in a separate thread with 4MB of stack all to itself. No idea why it needs so much but it works.
MatMaul
23rd August 2007, 17:01
thanks a lot !
I'm waiting for the new version.
MatMaul
23rd August 2007, 20:34
for the audio I propose an other method to don't have to wait for the decode of the whole audio track at the beginning :
1) as long as the read is linear, we just decode the stream in the same time as we provide it to avisynth and we store it in the cache too.
2) if a seek appears forward, we continue the decoding and storing in the cache to the demanded position then we provide to avisynth and continue like in 1
3) if a seek appears backward, I think we have no choice and we need to decode the whole stream in the cache before go in the decoded position.
it could be a good solution as I think more than 50% of this plugin use is linear.
Myrsloik
23rd August 2007, 20:43
Now explain how you intend to report the exact number of audio samples at the time the filter is created.
G_M_C
23rd August 2007, 20:43
Are you using LoadCPlugin to load it? (Note the extra "C" in there...)
LOL :D
Guess i noticed the extra C allright :p
MatMaul
23rd August 2007, 20:51
Now explain how you intend to report the exact number of audio samples at the time the filter is created.
yep right I didn't think about that :p
what about a first fast read without store the data in a cache (in the same time than the video indexing perhaps ?) ? but I don't know if this will be significantly faster than decode and store in the cache.
TheRyuu
23rd August 2007, 21:15
LOL :D
Guess i noticed the extra C allright :p
I don't think you need LoadCPlugin anymore. I thought that was just for one of the "interm" builds.
Myrsloik
23rd August 2007, 21:37
Parsing without decoding can't be done done for all formats due to variable block sizes (mp3 is fixed, vorbis isn't) so at least for some you'll end up having to decode every single audio frame to get a reasonable number. That and you'd still have to create the cache once you actually want to read the audio...
Inc
24th August 2007, 11:35
@Myrsloik
Did you look at the Videolan API? Maybe its more easy to implement that library as "Libavcodec" source as it also (as you know) bases on ffmpeg but maybe gots better Matroska etc etc etc support?!
Myrsloik
24th August 2007, 14:17
Version 1.9 released mostly for testing the flac cache stuff. If no one finds it useful I'll remove it in the next version.
Is there any useful documentation at all about libvlc? All I found was completely useless and didn't say anything at all about its limitations.
MatMaul
24th August 2007, 14:40
thanks a lot !!
a little bug : the video cache is created even if vtrack = -2
I will test the flac cache tonight.
Inc
27th August 2007, 09:28
@Myrsloik
IIRC at videolan.org in its develping section there you can find a documentation.
Regarding ffmpeg .... do you know this one? Maybe one or two included things can be useful for your work: http://www.dranger.com/ffmpeg/
ajp
28th August 2007, 10:39
I get an error when I try to use Flac compression... without it works fine.
"CAviStreamSynth: System exception - Access Violation at 0x0, reading from 0x0"
buzzqw
28th August 2007, 11:18
be sure to exclude any other filters problem
try an avs with ffmpegsource and your source file, no other filters
are errors present again?
BHH
ajp
28th August 2007, 12:20
Yes, in fact I was only using ffmpegsource...no other filters. I removed all other plugins from plugin folder as well, no luck...
FFmpegSource(source="movie.mkv", vtrack=-1, atrack=-1, timecodes="timecodes.txt", vcache = true, accompression = 1, pp="", ppquality = 6, seekmode = 1)
Myrsloik
28th August 2007, 21:47
No hints on what the file contains? does it happen with all files but only for you? You're making this far too simple for me and you should absolutely not upload a piece of whatever it is to ftp://upload:upload@mellbin.org/
If someone else is feeling generous and want flac to work for 8 and 24bit audio feel free to upload a small file because I'm too lazy to create that myself.
ajp
28th August 2007, 21:59
:)
The file contains one h264 track and one ac3 track. Normally I use NicAC3source for the audio but I wanted to try the complete ffmpegsource solution now that there's a chance to shrink the audio cache a little. I've tried a few different files with the same type of tracks, same error on all of them. I wanted to wait for someone else to comment on how it works but nobody has so...
I can't upload a sample right now, maybe tomorrow...
Thanks for the support.. :)
MatMaul
28th August 2007, 23:40
I don't have this problem, but problems with mono file : flac cache is twice bigger than wav cache and the audio is distorted
EDIT : if you want a sample this problem appears with my last mov sample I provided to you, and I have uploaded an other problematic mono file.
Myrsloik
29th August 2007, 01:47
New version (1.10). This one actually works.
ajp
29th August 2007, 08:24
Wohoo! Tried it, it works! :D
Any chance of DTS support as well? ;)
Myrsloik
29th August 2007, 11:02
DTS support where? I think libavcodec is already supposed to have its own decoder for it. Never tried it myself though.
ajp
29th August 2007, 11:10
Oh, I just assumed it didn't... never actually tried it! :D
imcold
4th September 2007, 00:26
great plugin, thanks a lot :)
Lele-brz
5th September 2007, 12:23
Hi,
I'm using FFmpegsource and it's great, no more mess with ffdshow...
But I found a regression, I used version 1.4 to encode using FFmpegSource a mov file with dvvideo + pcm_s16be and everything was ok.
Using version 1.10 I can encode but the resulting bitrate is not the one specified in x264.
Then just changing ffmpegsource files to version 1.4 everything worked ok.
anyone has some idea about it?
thanks in advance
bye
Myrsloik
5th September 2007, 13:16
The only difference is that x264 (different versions?) produce different sized output? Nothing else?
foxyshadis
5th September 2007, 13:23
Sounds like a framerate issue. Did you check to see if it changed to 25 instead of 23.976?
Lele-brz
5th September 2007, 15:03
>The only difference is that x264 (different versions?) produce > different sized output? Nothing else?
The big difference is that the bitrate is around 1 Mbps instead of the required 450, so the file is also bigger.
I have the same problem with version 1.8.
But If I just change to FFmpegSource 1.4 wihtout changing nothing else (x264) everything is ok.
About the bitrate I'll let you know I'm reencoding now.
thanks for answering
Lele-brz
5th September 2007, 16:07
no the framerate wasn't changed...
I also noted some AV sync problems on other format encoding with FFmpegSource
Wilbert
5th September 2007, 20:43
no the framerate wasn't changed...
I also noted some AV sync problems on other format encoding with FFmpegSource
Yes, vfr results in async video/audio when encoding straight to avi, because:
With vfr it just returns every encoded frame and sets the fps to 30.
I don't know how to circumvent it. Myrsloik, correct me, if i'm wrong. Perhaps Myrsloik can add a convertfps=true/false option ala DirectShowSource?
Of course you can always encode back to MKV with the timecodes file.
Myrsloik
6th September 2007, 21:31
The fps is no longer set to 30 fps unless the guessed value is completely insane. For mkv it's set to the average frame duration and for all other formats it's the first frame duration. Of course both fail in their own way once vfr is encountered...
If you for some inexplicable reason want to convert from vfr to cfr use the timecode file and write your own filter/program that generates an avisynth script with lots of duplicateframe or whatever your preferred method is. I really don't see the point and don't intend to add fps conversion ever.
IanB
6th September 2007, 23:53
I really don't see the point and don't intend to add fps conversion ever.I must say I am disappointed but I do understand. :(
As to the point, it is simply about providing the best service to our users.
While parsing the stream you have easy access to this timecode information and can easily reverse any temporal compression.
Generating a timecode file involves an extra parse of the input file, then a lot of stuffing around generating a devious script.
ficofico
7th September 2007, 18:56
Hi, ffmpegsource doesn't work with my e90 recording.
I've make a batch program that use a lot of different avisynth script with flash gui, in my computer and a few other, program work well using directshowsource as input, but in many computer program doesn't work, due to conflict with other codec (i presume) . It's very important for me that ffmpegsource really work in my program. Probably I haven't understand how to use this input plugins........., or there's a bug.
I've tried to encode a clip and this is the result:
VIDEO (http://ficofico.interfree.it/video4.rar)
the original video it's a video like this:
Video (http://ficofico.interfree.it/originale2.rar)
I've looking a lot for an input plugins like this...... very thanks for your work
Myrsloik
7th September 2007, 20:28
Read about seekmode in the manual. The "similar" video you posted doesn't show the issue. What was the input container anyway?
ficofico
7th September 2007, 21:12
The video it's original from my smartphone, I haven't recode the video.
I've tried seekmode 0-1-2 but neither work
Myrsloik
7th September 2007, 21:22
How did seekmode=0 fail? Did you try to remux the file to mp4 and if that fails mkv?
Yong
7th September 2007, 21:41
Hi, im using the 1.10 version, but it crash(ffmpegsource.dll crash) with x264 and xvid_encraw when certain options enabled:confused:
here is my avs script and x264/xvid encoding options.
i use this on my x264/xvid batch file.
FFmpegSource("%~1", vtrack = -1, atrack = -2,vcachefile="%temp%\%~n1.ffv",seekmode = 1).crop(0,6,0,-6).hqdn3d()
set x=start/b/w/low encraw2 -i "%temp%\%~n1.avs" -quality 6 -vhqmode 4 -bvhq -qpel -nopacked -lumimasking -progress 2 -size 8192 -frames 500
%x% -pass1 "%temp%\%~n1.log" -turbo
%x% -pass2 "%temp%\%~n1.log" -type 2 -o "%temp%\%~n1.mkv"it doesnt crash if i use 1pass encoding mode with default options.
start/b/w/low x264 "%temp%\%~n1.avs" -o "%temp%\%~n1.mkv" -b 3 --8x8dct --mixed-refs --crf 36 --me umh -A all --b-pyramid --weightb --no-fast-pskip --no-psnr --no-ssim --progress --frames 500
if i remove -A all and -me umh, problem will gone:p
btw, it only happen after the encoding is finish.
ficofico
7th September 2007, 21:46
Here you can find the original video, the recoded video and a txt file with my settings for avisynth and x264.
Videos (http://ficofico.interfree.it/videos.rar)
very thanks
Myrsloik
7th September 2007, 22:04
New version where Yong's issue is guaranteed to be fixed. Can't reproduce ficofico's problem here at all with 1.11.
ficofico
7th September 2007, 22:13
I'll waiting for 1.12 Myrsloik.......... thanks again
edit: I've tested now 1.11 , and as the 1.10 ,only the first 5 second of video are processed.
Yong
7th September 2007, 22:54
thanks alot, no more crash on 1.11:)
Lele-brz
10th September 2007, 09:16
Hi,
I'm using FFmpegSource to encode a vc-1 video (in a asf container) and I noticed that's ok, the video is encoded but there a problem with the AV sync, is there some option to set or VC-1 is not supported?
thanks for any help
Myrsloik
10th September 2007, 22:11
Is it vfr?
Lele-brz
11th September 2007, 09:03
Hi, thanks for answering
this are the specs of the video in question:
Filename: D:\testNewFormats\TVFINT_383_CONTENT.wmv
Container: asf
Extended: asf format
Bitrate: 1073198
Duration: 00:43:30
Video Codec: vc1
Audio Codec: wmav2
Video Size: 640 x 480
Video fps: 25
Audio channels: 2
Audio sample rate: 44100
Myrsloik
11th September 2007, 11:44
But is it vfr?
Lele-brz
11th September 2007, 13:30
sorry, I don't know, the tool I use for retrieving information is ffmpeg and it doesn't tell me if is varaible framerate...
thanks
Myrsloik
11th September 2007, 21:57
Hint: timecodes=...
TheFluff
12th September 2007, 21:17
In my experience, WMV in the .wmv/ASF container is almost always VFR or some kind. vOv
Myrsloik
15th September 2007, 00:45
New version. All colorspace conversions should finally work correctly (a bug in libavcodec's camtasia decoder made the testing very confusing). It's also possible to use ffmpegsource as a simple image reader with seekmode=-1. Animated gifs only seem to return the first frame though.
Mtz
15th September 2007, 08:06
I'm trying to use AutoMKV and buzzqw recommended me to unpack the ffmpegsource dlls to system32. After I made this, when I'm trying to open VirtualDubMod 1.5.4.1 I always have this error:
http://img502.imageshack.us/img502/177/vdmerrornt0.jpg
When I overwrited the dlls, I remember that the latest dll was from spring of 2007 (don't remember the date)
enjoy,
Mtz
foxyshadis
15th September 2007, 08:43
You're picking up an older version of ffmpegsource, I think. The latest version doesn't have that import. Check that no avsi files are loading older copies, for instance.
Mtz
15th September 2007, 12:33
I used the 1.12 version. Until this update, VDM worked very well for me and I had some older dlls in system32 like avcodec-51.dll. :(
buzzqw
15th September 2007, 12:51
search for all avcodec-51.dll in your disk and delete all BUT this correct dll in windows\system32
on of these dll could be on a windows path directory
BHH
Mtz
15th September 2007, 13:58
Deleted, but the same problem. Before updating to 1.11 or 1.12 I neverhad problems, even if I had old dlls on system.
Mtz
20th September 2007, 22:34
Can somebody give me a link with an old version (from spring) of the ffmpegsource? I want to test the old avcodec-51.dll.
buzzqw
21st September 2007, 08:27
look here http://www.64k.it/andres/dettaglio.php?sez=avisynth
BHH
Mtz
21st September 2007, 20:54
Thanks! Tried all versions and no luck. :( I think I'll reinstall my OS.
Myrsloik
6th October 2007, 22:03
New version with some minor fixes for timecodes and flv video.
Lele-brz
18th October 2007, 09:28
my 2 cents about ffmpeg libraried dlls.
Would it be possible to use the statically compiled version of them, so the ffmpegsource.dll will be self-contained.
What I noticed is that sometimes if on the machine there are other ffmpeg dlls it can link against them.
thanks
bye
Myrsloik
19th October 2007, 01:25
I hope you understand technobabble because that's what you just asked for...
Statically compiling with vs2005 is impossible, it doesn't use the same runtime library as mingw. Going back to vc6 isn't much fun either but it could work. I don't feel like doing all the work to find out but the source is available if anyone really wants to try it.
The other alternative is to use mingw. But then it has to be converted to a "c" plugin which in my last attempt failed miserably. Mostly since _fseeki64 and its friends only exists in msvcr80.dll and it didn't want to link it properly. For even more obscure reasons it didn't seem to fully appreciate haali's code either. But it was all statically linked and annoying to debug.
Then there's the lesser evil kind of solution. Link the ffmpeg dlls by symbol names instead of by ordinal. This would in theory make it possible to replace all dlls without recompiling and share the same set between all programs (major version changes excluded). This is however greatly discouraged and done by no one since the generated import libraries on windows link by ordinal. Fortunately I don't use my own plugins that much so why bother...
Farewell cruel world?
akupenguin
19th October 2007, 10:19
The other alternative is to use mingw. But then it has to be converted to a "c" plugin which in my last attempt failed miserably. Mostly since _fseeki64 and its friends only exists in msvcr80.dll and it didn't want to link it properly.
Is there a difference between _fseeki64 and fseeko64? The latter works in mingw.
Myrsloik
19th October 2007, 19:18
I guess the difference is that one is microsoft approved and the other isn't. One day I really should learn this C (with and without ++) stuff.
Chainmax
22nd October 2007, 03:40
I want to open a DXA video in Avisynth, do I need anything else than FFMPEGSource?
Myrsloik
26th October 2007, 02:56
This Is A Version Only Intended For Testing, Idiots Should Skip This Post
This test version uses a new way to decode audio without using a huge uncompressed audio cache. Matroska files need no additional space and all other containers have the original demuxed audio track stored in c:\ffmpegsource.cache (this test version only).
The decoding results seems to be identical (dithering/other parts of codecs that prevent it but makes no difference) when run multiple times when compared to itself. It does however differ a lot from ffmpegsource(atrack=-1) and I have no idea why that is. There are at least no audible artifacts (to me) so report if it works properly.
Usage:
FFAudioSource(string source)
Link (http://ivtc.org/new/beta/FFMpegSource_audio_test.rar)
Wilbert
27th October 2007, 14:39
@Myrsloik,
Recently MLP decoding was added: ffmpeg-mailinglist (http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2007-October/thread.html#36628). Could you add this to FFAudioSource? I would be very grateful!
Myrsloik
27th October 2007, 19:10
I tried to compile a newer ffmpeg the usual way but I get this error:
gcc -shared -Wl,--output-def,avformat-51.def -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-auto-image-base -Wl,--warn-common -Wl,-rpath-link,"/c/libraries/ffmpeg"/libavcodec -Wl,-rpath-link,"/c/libraries/ffmpeg"/libavformat -Wl,-rpath-link,"/c/libraries/ffmpeg"/libavutil -o avformat-51.dll allformats.o cutils.o os_support.o sdp.o utils.o avio.o aviobuf.o raw.o aiff.o riff.o amr.o apc.o ape.o asf.o asfcrypt.o au.o avidec.o avs.o vocdec.o voc.o bethsoftvid.o c93.o daud.o dsicin.o dv.o dxa.o electronicarts.o ffm.o flic.o flvdec.o 4xm.o gifdec.o gxf.o idcin.o img2.o ipmovie.o matroskadec.o matroska.o mm.o mmf.o mov.o isom.o mp3.o mpc.o mpeg.o mpegts.o mtv.o mxf.o nsvdec.o nutdec.o nut.o nuv.o ogg2.o oggparsevorbis.o oggparsetheora.o oggparseflac.o oggparseogm.o rtsp.o rmdec.o idroq.o segafilm.o siff.o smacker.o sol.o psxstr.o swf.o thp.o tiertexseq.o tta.o txd.o sierravmd.o wav.o wc3movie.o westwood.o wv.o yuv4mpeg.o file.o http.o rtpproto.o tcp.o udp.o -L"/c/libraries/ffmpeg"/libavutil -lavutil -lavcodec -L"/c/libraries/ffmpeg"/libavcodec -lz -lm -la52 -lfaad -lws2_32
c:/libraries/ffmpeg/libavcodec/libavcodec.a(cscd.o): In function `decode_frame':
c:/libraries/ffmpeg/libavcodec/cscd.c:161: undefined reference to `lzo1x_decode'
c:/libraries/ffmpeg/libavcodec/libavcodec.a(nuv.o): In function `decode_frame':
c:/libraries/ffmpeg/libavcodec/nuv.c:168: undefined reference to `lzo1x_decode'
c:/libraries/ffmpeg/libavcodec/libavcodec.a(cook.o): In function `scalar_dequant_float':
c:/libraries/ffmpeg/libavutil/random.h:45: undefined reference to `av_random_generate_untempered_numbers'
c:/libraries/ffmpeg/libavcodec/libavcodec.a(cook.o): In function `cook_decode_init':
c:/libraries/ffmpeg/libavcodec/cook.c:1069: undefined reference to `av_init_random'
c:/libraries/ffmpeg/libavcodec/libavcodec.a(mpc.o): In function `mpc7_decode_frame':
c:/libraries/ffmpeg/libavutil/random.h:45: undefined reference to `av_random_generate_untempered_numbers'
c:/libraries/ffmpeg/libavcodec/libavcodec.a(mpc.o): In function `mpc7_decode_init':
c:/libraries/ffmpeg/libavcodec/mpc.c:83: undefined reference to `av_init_random'
c:/libraries/ffmpeg/libavcodec/libavcodec.a(nellymoserdec.o): In function `decode_init':
c:/libraries/ffmpeg/libavcodec/nellymoserdec.c:401: undefined reference to `av_init_random'
c:/libraries/ffmpeg/libavcodec/libavcodec.a(nellymoserdec.o): In function `nelly_decode_block':
c:/libraries/ffmpeg/libavutil/random.h:45: undefined reference to `av_random_generate_untempered_numbers'
collect2: ld returned 1 exit status
make[1]: *** [avformat-51.dll] Error 1
make[1]: Leaving directory `/c/libraries/ffmpeg/libavformat'
make: *** [lib] Error 2
It seems like it can't find the libraries it's compiled itself or something similar. No idea what to do about it.
Myrsloik
28th October 2007, 04:25
New compile of the test version. Includes a recent ffmpeg and it's now statically linked (flac cache not enabled since it didn't want to link).
Link (http://ivtc.org/new/beta/FFMpegSource_audio_test.rar)
Wilbert
28th October 2007, 14:07
Thx! I got it working for AAC and MP4/AAC, although i didn't test it very well. It seems that the MLP/TrueHD patches are not added to the SVN yet, but i will keep an eye on it.
tateu
29th October 2007, 20:43
@Myrsloik,
You might want to try "strip -x libavcodec.a" on all the ffmpeg libs for the static compile. In my tests, that cuts the resulting dll size down to about 3MB.
Wilbert
30th October 2007, 22:26
@Myrsloik,
Kurtnoise created a patch for E-AC3/MLP (ffmpeg)! Could you incorporate that in FFAudioSource?
patch: http://kurtnoise.free.fr/index.php?dir=misc/
Thanks again!
Myrsloik
30th October 2007, 22:35
If I did you would have no motivation to get it integrated into the main branch. The source is still available if someone really wants to make their own build with an "improved" ffmpeg and I don't mind answering compilation questions... AS LONG AS YOU CLEARLY LABEL IT AS NOT COMPILED BY ME. You could even get your own link in the first post! Apply now!
Kurtnoise
1st November 2007, 09:23
@Wilbert: Done... (http://kurtnoise.free.fr/index.php?dir=misc/&file=FFmpegSource_r10891.7z) but not tested. :)
@Myrsloik: why using FLAC as external lib ? FFmpeg has his own FLAC decoder...
Leak
1st November 2007, 11:13
@Myrsloik: why using FLAC as external lib ? FFmpeg has his own FLAC decoder...
I was under the impression he also needed a FLAC encoder for the audio cache - does ffmpeg do FLAC encoding as well?
np: Prefuse-73 - Every Party Has A Winner And A Loser (Unrest)
Kurtnoise
1st November 2007, 11:55
I was under the impression he also needed a FLAC encoder for the audio cache - does ffmpeg do FLAC encoding as well?
yes it does...
Wilbert
1st November 2007, 22:16
@Kurtnoise13,
http://rapidshare.com/files/66801815/ffmpeg_samples.zip.html contains some samples: AAC, MP4/AAC and MLP.
The AAC, MP4/AAC played, but the sound was a bit garbled.
The MLP (44.1 kHz, 16 bit) didn't play at all, it gave the error: 'Audio decoding error'. Script:
v = BlankClip()
a = FFmpegSource("D:\Install\dvd-audio\TheCorrs\DVDAExplorer\Acapela1.mlp", vtrack=-2, atrack=-1)
AudioDub(v,a)
http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2007-October/036639.html contains a raw-mlp support patch. I don't know whether that was included in your patch? (Perhaps related, perhaps not :))
Myrsloik
2nd November 2007, 00:33
The reason is very simple, I'm lazy.
Actually libflac has a nice api that allows sample accurate seeking all the time and is extremely simple to use. With libavformat seeking is much less fun and where you end up is usually a bit uncertain (if it wasn't, someone else probably would've made ffmpegsource before me).
Kurtnoise
2nd November 2007, 14:45
I don't know whether that was included in your patch? (Perhaps related, perhaps not :))
Yes, you're right. I forgot this. New build uploaded. Should be fine now...:)
About aac multichannel files, dunno why it doesn't work properly actually...I'll try something else later.
Wilbert
2nd November 2007, 22:37
Yes, you're right. I forgot this. New build uploaded. Should be fine now...
It works, i'm so excited!!!!!!!! Thanks you very much!
One additional request though :) 24 bit stuff is reported as 16 by AviSynth. I'm not sure whether it is converted to 16 bit down the road, or if the patch doesn't support 24 bit. I got an example here:
http://rapidshare.com/files/67023394/ffmpeg_samples2.zip.html
Perhaps you can look at it. If the patch doesn't support it, i will contact Ian Caulfield.
Myrsloik
2nd November 2007, 22:49
From avcodec.h:
/* Currently unused, may be used if 24/32 bits samples are ever supported. */
/* all in native-endian format */
enum SampleFormat {
SAMPLE_FMT_NONE = -1,
SAMPLE_FMT_U8, ///< unsigned 8 bits
SAMPLE_FMT_S16, ///< signed 16 bits
SAMPLE_FMT_S24, ///< signed 24 bits
SAMPLE_FMT_S32, ///< signed 32 bits
SAMPLE_FMT_FLT, ///< float
};
Further down...
/**
* audio sample format
* - encoding: Set by user.
* - decoding: Set by libavcodec.
*/
enum SampleFormat sample_fmt; ///< sample format, currently unused
Wilbert
2nd November 2007, 23:11
That sounds bad. Does that mean that outputting 24 bit is still not supported in ffmpeg?
tebasuna51
3rd November 2007, 01:36
That sounds bad. Does that mean that
outputting 24 bit is still not supported in ffmpeg?
Yep, ffmpeg convert anything to 16 bit and preserve the original channel mapping (of course the ac3/aac multichannel conversions are wrong channel mapped).
I think we need preserve the original precision (bitdepth) and use a standard channel mapping for decoder-encoder compatibility.
Wilbert, don't know this thread (http://forum.doom9.org/showthread.php?p=1043284#post1043284)?
Justin answer about ffmeg bitdepth and multichannel behaviour, there are also a solution to work with NeroAacEnc stdin requested by you in other thread.
Kurtnoise
3rd November 2007, 09:11
From mlp_parser.c :
#ifdef CONFIG_AUDIO_NONSHORT
avctx->bits_per_sample = mh.group1_bits;
if (avctx->bits_per_sample > 16)
avctx->sample_fmt = SAMPLE_FMT_S32;
#endif
MoFoQ
8th November 2007, 04:03
@EAC3 capable ffmpeg: that's cool!
ok...so..how do I use it in avisynth?
Wilbert
11th November 2007, 14:57
1) Get ffmpeg_eac3_mlp_rev10905.7z from http://kurtnoise.free.fr/index.php?dir=misc/, and put it in AviSynth plugin folder.
2) Get FFmpegSource-1.13.rar from the first post in this thread and put all the dlls (except ffmpegsource.dll which is an AviSynth plugin, this one is the same as above except for the MLP/TrueHD/E-AC3 decoding support) in your system folder.
Yobbo
11th November 2007, 20:51
1) Get ffmpeg_eac3_mlp_rev10905.7z from http://kurtnoise.free.fr/index.php?dir=misc/, and put it in AviSynth plugin folder.
This .7z file contains ffmpeg.exe? Do I put this is my Avisynth folder? Or in Plugins subfolder? Or?
Kurtnoise
11th November 2007, 21:01
If you need *only* the avisynth stuff, the FFmpegSource package is sufficient. No need to grab FFmpeg...
Yes, FFmpegSource must be in your Avisynth plugins folder unless you want to use some LoadPlugin(...).
At last, neither FFmpegSource nor FFmpeg require some dlls to work for.
MoFoQ
11th November 2007, 22:27
ok updated...I got the avisynth ffmpegsource plugin to work...unfortunately, it doesn't seem to want to work with the eac3 file I want to convert.
with the standalone, it would start to convert but will hang at around 9000+ frames (roughly 1:30 into the clip).
the avisynth version will not even start though it doesn't complain about the plugin.
is there something I can do to help debug?
Kurtnoise
12th November 2007, 12:13
what kind of script did you use ?
TrueIndigo
26th November 2007, 22:41
I’m having a sound problem playing an avs file in VirtualDubMod using ffmpegsource to reference an avi. The picture plays ok, but there is no sound (checking VirtualDubMod’s properties of the avs file shows there is no audio information), though playing the avi directly in VirtualDubMod proves the avi itself has sound. The file type is XviD mpeg-4 avi, and the simple test script is shown below:
LoadPlugin("c:\Program Files\Avisynth 2.5\Plugins\FFMpegSource.dll")
ffmpegSource("d:\Video tests\Avisynth -- 4\v1h2-1-1.avi")
I’m not sure if my script is incomplete, my location of ffmpegsource is wrong*, or I don’t have a suitable sound plugin which Avisynth needs. In the folder containing the avs and avi, the ffv0cache file (video) has been created but no audio cache file.
This is the first time I’ve used ffmpegsource, and I’m still a newbie with Avisynth itself, so any help is gratefully accepted. Many thanks.
*Although some advice on this thread suggests putting files in system32, and the main dll in Avisynth’s plugins folder, I read the html page which comes with the unzipped ffmpegsource files, and this says you can put all the files in the Avisynth plugins folder. I elected to do this - don’t know if it has a bearing on my sound problem.
Wilbert
26th November 2007, 22:59
I think you need to use:
FFAudioSource("D:\move.avi", atrack=-1)
to get the audio track.
TrueIndigo
27th November 2007, 20:01
Wilbert -- thanks. I tried your suggestion but it still didn’t work, however putting your code inside the brackets did work, as shown below:
LoadPlugin("c:\Program Files\Avisynth 2.5\Plugins\FFMpegSource.dll")
ffmpegSource("d:\Video tests\Avisynth -- 4\v1h2-1-1.avi", atrack=-1)
So now I have sound, but I noticed it is not in sync. It does not appear to be an accumulation of sync loss, but is constantly out throughout the clip (it looked "early", and at the end the sound finishes just before the imagery stops). Am I doing something wrong; is this a known problem; is there a fix? I tried the same avi file using AviSource and there was no sync problem.
ficofico
27th November 2007, 21:26
I'm trying to do a bad work;)
I've seen that using ffmpegsource it's possible to print a timecode v2 , and after process my mp4 file trough avisynth and x264, I've found that using tc2mp4 it's possible to paste the timecode into the new mp4 file.
Now I want to do more..... I usually double framerate of this vfr video using avisynth script and mediainfo framerate, but obviously video isn't in sync with audio for all the frame, because the framerate it's vfr. If I first encode my vfr video with "Super" to cfr framerate , using my program that doubleframerate I have no trouble, but it's not an elegant way to do batch procesing. My question is:
Is there a way to use this ffmpegsource timecode file for processing vfr video doubling the framerate maintaining audio - video synch ? also using 2 pass or 3 pass ecc ecc....:thanks:
foxyshadis
28th November 2007, 00:16
ficofico, if you strictly double, then all you need to do is interpolate a new timestamp halfway between each existing one in the file. And one more at the end for good measure. When you remux it should be in sync.
TrueIndigo, you'll probably have to use avisynth's built in audio delay function, I guess ffmpegsource doesn't look at that yet.
cweb
28th November 2007, 19:05
Is it possible to get ffmpeg to do a video resize when ffmpegsource calls it?
Because I've got an flv which is 320x239 and I want to open in in avisynth resized to 320x240. directshowsource is giving me a CAVIstreamerror when I try to open it that way, so I tried ffmpegsource instead, but I got an error that the video is the wrong size...
Wilbert
28th November 2007, 19:13
Because I've got an flv which is 320x239 and I want to open in in avisynth resized to 320x240. directshowsource is giving me a CAVIstreamerror when I try to open it that way, so I tried ffmpegsource instead, but I got an error that the video is the wrong size...
I guess it tries to open it as YV12, which is not possible (height should be even). Use DirectShowSource with pixel_type="YUY2" (or 'RGB") to force it to open it as YUY2.
cweb
28th November 2007, 19:27
I guess it tries to open it as YV12, which is not possible (height should be even). Use DirectShowSource with pixel_type="YUY2" (or 'RGB") to force it to open it as YUY2.
BTW I have ffdshow to do a resize to 320x240 at the moment to get it to load but still..
With the other stuff in the script to resize and improve it a bit (usual stuff from the forums) I was getting a memory access error most of the time too.
That's what's happening. Thanks.
I found a workaround, I just opened it with directshowsource with no other processing in the script and encoded it to huffy. Now I can open the huffy avi with ffmpegsource or avisource and do the processing I wanted to do...
I tried, just for fun, opening with directshowsource with pixel_type="yuy2", with the same stuff in the script, plus a lanczosresize to 320x240. Well first it crashed with a memory access error in Virtualdub, then the next time it worked.
Ok the good thing is I found the workaround...
Myrsloik
28th November 2007, 19:28
Upload the video or a part of it to ftp://upload:upload@mellbin.org and I will look at it. Should at least be possible to pad yv12 to even widths and heights and let the user crop away the junk if necessary.
cweb
28th November 2007, 20:08
Upload the video or a part of it to ftp://upload:upload@mellbin.org and I will look at it. Should at least be possible to pad yv12 to even widths and heights and let the user crop away the junk if necessary.
Done.. thanks.
Wilbert
28th November 2007, 21:55
I saw that MLP/TrueHD is added to the SVN:
http://svn.mplayerhq.hu/ffmpeg/trunk/
I hope that there will be a new build :)
Myrsloik
29th November 2007, 09:10
There will be as soon as I finish the cache stuff for ffaudiosource which will probably be this weekend.
Kurtnoise
29th November 2007, 09:49
I saw that MLP/TrueHD is added to the SVN:
http://svn.mplayerhq.hu/ffmpeg/trunk/
I hope that there will be a new build :)
only the parser...the decoder is still in review.
TrueIndigo
29th November 2007, 20:11
Foxyshadis -- thanks for the help. I must look into how I would script audio delay, and if there is any way the delay factor can be accurately gauged (rather than just my estimate). My original query came from a test sourcing an mpeg-4 avi. I have since tried a Huffyuv avi but the "early" sound sync loss was exactly the same with this test as well. I had wondered if it might have been some obscure mpeg-4 issue (even though inside an avi container), but it appears not.
Thanks.
foxyshadis
1st December 2007, 09:40
I'd load it into soundforge, or any NLE that's handly and shows audio graphically, but that doesn't help if you don't have one. Audacity might be able to help, though.
Wilbert
28th December 2007, 16:54
@Myrsloik,
What happens if you open a file (which is DV with color format 4:1:1)?
http://forum.doom9.org/showthread.php?p=1080432#post1080432
Is this a bug in ffmpegsource (for example it doesn't check the color format which is outputted by the decoder, or it doesn't request the appropriate color format from the decoder), or is ffmpeg not decoding it correctly?
Myrsloik
28th December 2007, 17:02
Not much because I don't seem to have any DV files at all. Do I get a free sample?
foxyshadis
28th December 2007, 20:23
http://www1.mplayerhq.hu/MPlayer/samples/DV-raw/ Here's one of the same format.
Myrsloik
28th December 2007, 22:36
My results:
FFmpegSource: same odd stuff as in the screenshot
FFmpeg.exe: Unable to find a suitable output format for 'c:/FFmpegSource/voxnews.dv'
Mplayer: dies instantly unless two instances are launched at the same time and then one seems to work
I don't think it's my fault this time...
themostestultimategenius
29th December 2007, 04:59
Try using QTSource?
Incase you don't have the plugin (Just too lazy to search for the thread with it =p)
http://www.mediafire.com/?ahw5eznzazp
Myrsloik
5th January 2008, 14:24
Version 1.14 released. The main new thing is that it's statically linked (only one dll) and is linked with a much newer ffmpeg.
buzzqw
5th January 2008, 14:49
with 1.14 i got stuck with "LoadPlugin: unable to load c:\xx\ffmpegsource.dll"
even if i keep all other dlls ( like avcodec-51.dll, avformat-51.dll ... from previus package ) in windows\system32
BHH
Nikos
5th January 2008, 16:14
Ver. 1.13 works fine but 1.14 give me errors with or without the old dlls.
"Script open failed"
Myrsloik
5th January 2008, 16:33
The file is updated now. For some reason I can't understand the release compile didn't link properly.
buzzqw
5th January 2008, 16:50
yes! now working!!
BHH
Nikos
5th January 2008, 17:19
Thanks, now working fine!!!
Kurtnoise
5th January 2008, 21:19
Version 1.14 released. The main new thing is that it's statically linked (only one dll) and is linked with a much newer ffmpeg.
Thanks for the new release. Did you have include some patches with it (E-AC3 decoder, TrueHD/MLP...) or not ?
Myrsloik
5th January 2008, 21:30
No, it remains patchless. I'm too lazy to bother with adding those things as I don't need it myself and at least one day they'll hopefully be integrated. Feel free to make your own compiles of it..
jmartinr
12th January 2008, 16:01
Thanks for the good work.
But unfortunately DV stil gives a sort of scrambled outcome.
Screencapture is here: http://www.nkbv.nl/blobs/wedstrijden/test/palintlt.bmp
Script is here: http://www.nkbv.nl/blobs/wedstrijden/test/palintlt.avs
AVI (Pal DV) is here: http://www.nkbv.nl/blobs/wedstrijden/test/palintlt.avi
1.13 had the same error. Avi does play in ffplay SVN-r8891.
Myrsloik
12th January 2008, 18:55
The file decodes in a just as messed up way with a recent ffplay. Not my fault and I have no idea what causes it.
jmartinr
12th January 2008, 23:18
Could you tell me which version of ffplay that is? Rev11143 still works fine. :confused:
Myrsloik
12th January 2008, 23:35
I think c/c++ compilers hate me in general. One recompile of ffmpeg+ffmpegsource and it works. Behold the newer version which will be known as 1.15.
jmartinr
13th January 2008, 15:05
:thanks:
Klute
14th January 2008, 13:10
ive got a problem with an quicktime file, which has a res of 582x319.
when i try to transcode it using ffmpegsource, i get an "YV12 images for output must have a width divisible by 4 (use crop)!" error.
:-/
Beastie Boy
14th January 2008, 13:19
"YV12 images for output must have a width divisible by 4 (use crop)!":-/
The error message is quite clear. Neither 582 or 319 are multiples of 4, so...
Klute
14th January 2008, 13:34
The error message is quite clear. Neither 582 or 319 are multiples of 4, so...
yes, i know. the problem is, that im searching for a way to encode lots of different files without having to change the script all the time.
version 1.14 at least fixed the problem that i had with the uneven height.
edit: ahhh, i know, now that the uneven height problem is gone, i can just convert to another colorspace... thanks for hinting me in the right direction ;)
Leak
14th January 2008, 13:55
yes, i know. the problem is, that im searching for a way to encode lots of different files without having to change the script all the time.
How about putting something like
Crop(0,0,-(last.width%4),-(last.height%4))
at the end of your script?
I'd say cropping up to 3 pixels at the right and bottom side shouldn't be much of a problem...
Klute
14th January 2008, 14:24
thanks :)
IanB
14th January 2008, 21:54
Only the width is restricted to mod 4, the height can be mod 2Crop(0,0,-(last.width%4),-(last.height%2))
cweb
22nd January 2008, 13:50
Today I tried opening a pal dv avi using ffmpegsource with the parameter atrack=-1. the frame rate is 100 instead of 25fps..
function dvsource(string name)
{
ffmpegsource(name,atrack=-1)
}
video=dvsource("video1.avi")
video=video.info()
video
Myrsloik
22nd January 2008, 16:50
You must have a very special avi file. Make sure to treasure it for it will bring you much happiness.
DarkZell666
23rd January 2008, 11:22
And I ate an apple yesterday ... :D
@cweb : Unless you were interrupted while writting your post, I don't see the point either, did something actually go wrong ? :p
If so, what precisely ?
cweb
23rd January 2008, 11:40
And I ate an apple yesterday ... :D
@cweb : Unless you were interrupted while writting your post, I don't see the point either, did something actually go wrong ? :p
If so, what precisely ?
It gave the wrong frame rate.. double the supposed amount.
However I noticed afterwards that I had *another* dvsource function in another include file, and it was calling *that* function instead of the one in the main avs file...
so sorry about that. ffmpegsource for a dv avi seems not to work like someone else had posted. I took the alternative of merging my dv avi's using virtualdub into combined avi's instead and I accessed them using avisource again..
DarkZell666
23rd January 2008, 15:13
Today I tried opening a pal dv avi using ffmpegsource with the parameter atrack=-1. the frame rate is 100 instead of 25fps..
That info wasn't in your post originally (unless I've got early eye disease ? oO)
So you edited it, and somehow the "Last Edited by cweb at xx:xx:xx" message isn't mentionned at the bottom of your post.
wtf !? :eek:
cweb
23rd January 2008, 15:50
That info wasn't in your post originally (unless I've got early eye disease ? oO)
So you edited it, and somehow the "Last Edited by cweb at xx:xx:xx" message isn't mentionned at the bottom of your post.
wtf !? :eek:
No I didn't edit the info about the frame rate.. it was there in the first place.
DarkZell666
23rd January 2008, 17:23
... my apologies then :rolleyes:
cweb
23rd January 2008, 18:32
... my apologies then :rolleyes:
No problem.. :)
ernstblaauw
14th February 2008, 17:42
In the first post, FFAudioSource is called 'experimental'. I used it to open a slightly corrupted MP3 file (MPASource did not manage to openit correctly), and it worked ok for me. Does it need more testing? Or is it just "not tested but implemented"?
However, I'm very happy with this plugin - I hope you'll develop this one further (if needed, of course :-). Thanks!
Atak_Snajpera
14th February 2008, 17:49
MPASource doesn't support mp3
ernstblaauw
14th February 2008, 17:54
MPASource doesn't support mp3
It does - for example DVD slideshow GUI uses it for loading mp3 files. See also http://avisynth.org/mediawiki/Importing_media, it is stated there.
Myrsloik
14th February 2008, 20:26
It is highly experimantal. In this case experimental means "this may or may not work properly but I'm too lazy to find out myself so now I'm going to release it on the internet and do something else and see what happens". Not much happened so either no one uses it or it works well enough most of the time.
Future ideas if anyone wants to comment:
Make indexing a single separate step and index all streams present in a file at once (no idea what to do about audio with variable block sizes, maybe it will be fast enough anyway even if those have to be decoded)
Separate FFmpegSource into FFVideoSource and FFAudioDump (write as wave(64) files and then use wavsource to return it if necessary)
Add swscale (just because it's there, would only provide alternatives to colorspace conversion functions with some additional settings possible)
Compile with mlp/eac3 patches (if there's still any real demand)
Make it possible to set the number of threads libavcodec uses for decoding (note that most decoders aren't multithreaded anyway)
ernstblaauw
14th February 2008, 20:30
It is highly experimantal. In this case experimental means "this may or may not work properly but I'm too lazy to find out myself so now I'm going to release it on the internet and do something else and see what happens". Not much happened so either no one uses it or it works well enough most of the time.
For me it works well enough most of the time :-). Good luck with the 'road map' you just posted. This is really a great plugin!
shita
29th February 2008, 03:56
Can you help me link to get ffplay.exe for win in ffmpeg project ? Thanks
buzzqw
29th February 2008, 08:25
@shita
http://ffdshow.faireal.net/mirror/ffmpeg/ffmpeg.rev11870.7z
BHH
jase99
8th March 2008, 05:08
I need fast frame accurate vc1 seeking. seekmode=0 works but is too slow. seekmode=1 does not work, if the container is:
evo: sometimes frame accurate, sometimes not
vc1: cannot seek
avi: could not open video codec
mkv: could not open video codec
With the mkv container, here is error reported under linux/wine:
Avisynth error:
FFmpegSource: Video codec not found
(test.avs, line 1)
[matroska @ 00A7E028]Unknown entry 0xbf in info header
[matroska @ 00A7E028]Unknown entry 0x73a4 in info header
[matroska @ 00A7E028]Unknown entry 0xbf in track header
[matroska @ 00A7E028]Unknown/unsupported CodecID V_VC1.
Is there a version of ffmpegsource that supports fast frame accurate seeking?
Myrsloik
8th March 2008, 09:06
Tthe matroska part is a bit special as it requires a table that maps the matroka codec names to decoders in libavcodec. Guess I'll have to ask haali to update the list with all new codecs that can be stored in matroska.
...and yes, there is a version that supports fast frame accurate seeking but you can't have it.
jase99
8th March 2008, 20:17
If there is already a version that has fast (e.g., seekmode=1) accurate frame seeking of vc1 in a container ffmpegsource can read then is there a reason why I may not try it? Alternatively, would you be able to suggest another approach that I could investigate?
The problem I have is my avis script is very slow, 108 hours to run through a 2 hour movie, and thats just dumping the output of avs2yuv to /dev/null. I have 96 cores available and am trying to split up the avis processing across them. I split up the script with trim()'s and encode to huffyuv each of the 96 parts in parallel, then feed the joined result (with another script) into x264. H.264 and MPEG-2 are working fine with dgavcdec and dgindex but vc-1 continues to be a problem because i have not found a frame accurate solution.
TheFluff
8th March 2008, 23:28
If there is already a version that has fast (e.g., seekmode=1) accurate frame seeking of vc1 in a container ffmpegsource can read then is there a reason why I may not try it?
Check your sarcasm detector, I believe it is broken.
jase99
9th March 2008, 01:56
Oops, yep I guess it was. :)
Myrsloik
9th March 2008, 02:19
It's time for a small update. This one probably brings more interesting miscompilation issues in one way or another as it has ffmpeg compiled with --enable-w32threads. The new things are multithreaded decoding (in the few decoders where it's available if threads is set), many missing matroska codec ids added (like native vc1) and as usual a newer ffmpeg revision (and many fixes in the source for compiling against a newer ffmpeg revision).
...unless you're named jase99 in which case you can't download it.
jase99
9th March 2008, 03:25
Wow, that was fast. Doesn't work for me (vc1 in mkv):
1.15 - Video codec not found
1.16 - Could not open video codec
Myrsloik
9th March 2008, 17:45
Upload a small (1 GB or less) vc1 in mkv clip to ftp://upload:upload@mellbin.org/ and I'll look at it some more.
jase99
10th March 2008, 02:38
I used mkvmerge's split option to make a small file and uploaded test50mb.mkv, hope its large enough.
This is my avis:
FFmpegSource("test50mb.mkv",timecodes="test50mb.tc",vtrack=-1,atrack=-2,vcache=true,vcachefile="test50mb.cache",pp="",ppquality=0,seekmode=1)
EDIT:
I tried re-muxing to mp4 (another frame accurate container) using ffmpeg (muxing seemed to work) and openeing in ffmpegsource, no go. A quick update to my earlier post about opening vc1 in a container:
vc1: Video track is unseekable
evo: opens but not always frame accurate with seekmode=1 (seekmode=0 too slow)
avi: Could not open video codec
mkv: Could not open video codec
mp4: Could not open video codec
Since avi/mkv/mp4 all report the same message, I wonder if it is a generic problem with ffmpegsource's interface to ffmpeg's vc1 decoder?
Myrsloik
10th March 2008, 23:29
Don't expect this to be solved anytime soon because it seems to be caused by things far beyond my control.
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.