View Full Version : FFmpegSource


Pages : [1] 2 3

Myrsloik
16th June 2007, 21:12
TRIGGER WARNING

The posts contained in this thread may be very upsetting for users of old operating systems, old cpus and stupid people

-------------------------------------------------------

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.

Github project (https://github.com/FFMS/ffms2)

Latest binaries (https://github.com/FFMS/ffms2/releases)

Note: The real name is "Fabulous FM Source 2" and is in no way related to FFmpeg.

How to use as an image source in VapourSynth:
import vapoursynth as vs

first_image = 4
num_images = 160
filename_pattern = 'D:/imgseq/output_{0:05d}.jpg'

c = vs.get_core()
placeholder_clip = c.std.BlankClip(clip=c.ffms2.Source(filename_pattern.format(first_image), cache=False), length=num_images)
def image_loader(n):
return c.ffms2.Source(filename_pattern.format(n + first_image), cache=False)[0]
clip = c.std.FrameEval(placeholder_clip, image_loader)
clip.set_output()

Wilbert
16th June 2007, 21:40
That's cool stuff! I will try it out tomorrow!

foxyshadis
17th June 2007, 01: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, 11: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, 12: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, 14:49
edit...wrong manip.

Kurtnoise
17th June 2007, 14: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, 17: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, 07: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, 10: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
19th June 2007, 23: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
19th June 2007, 23: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, 06: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, 20: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, 21: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
20th June 2007, 23: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, 06: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, 07: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, 14: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, 14: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, 20: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, 17: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, 11: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, 13: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, 21: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, 22: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.

Leak
2nd July 2007, 22:57
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
2nd July 2007, 23: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, 22: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, 06: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, 16: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, 18: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, 18: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, 19: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, 20:07
ops..................sorry, but I've assume that the name was a constant.

Myrsloik
13th July 2007, 20:07
My guess is that you're using the ffmpeg dlls from a previous version/other program.

ficofico
13th July 2007, 20: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, 14: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, 16: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, 00: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, 16: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, 14: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, 17: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, 11: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, 11: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, 18: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, 19:00
Did I ever claim to have compiled ffmpeg with any additional libraries?

buzzqw
21st July 2007, 19: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, 21:51
I suggest liba52 and libfaad2 then we can decode ac3 and aac streams which are very common.

tebasuna51
22nd July 2007, 00: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, 12: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, 09: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

ajp
26th July 2007, 12:36
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, 15:30
What's the problem with directshow-based ones? :confused:

ajp
26th July 2007, 19:24
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, 20: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.

ajp
27th July 2007, 08:05
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, 09: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

ajp
27th July 2007, 10:18
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 :) )

ajp
27th July 2007, 17:21
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, 16: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, 18:33
Hurrah for Myrsloik!!!! :thanks: Very useful and time-saving :)

ajp
29th July 2007, 17:39
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, 17: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, 17:57
would be possible to build with standard interface ? with loadplugin ? is more handy

thanks

BHH

ajp
29th July 2007, 18:18
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, 21: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.

ajp
29th July 2007, 22:26
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, 22: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.

ajp
29th July 2007, 22:59
Hmmm, that's weird.. now it's the correct version. Maybe I had it cached or something... thanks!

ajp
30th July 2007, 07:21
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, 12: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.

ajp
30th July 2007, 12:20
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

ajp
30th July 2007, 12:26
Now I get "System exception - Stack overflow" with .mkv... :eek:

Myrsloik
30th July 2007, 12:41
Exactly what does the mkv contain? Could you cut a piece of it and upload to ftp://upload:upload@mellbin.org ?

ajp
30th July 2007, 12:48
It contains just an AVC/H264 video stream and the AC3 stream...

Uploading a sample shortly...

Myrsloik
30th July 2007, 13:02
It works here. Did you try deleting all old cache files?

ajp
30th July 2007, 13:09
Yes, deleted all old cache files. I'll reboot my machine shortly too just in case...

What commandline did you use in your .avs?

ajp
30th July 2007, 13:21
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, 18: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, 19: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, 20: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, 11:38
all i ever get is: cant load ffmpegsource.dll..., what is there to do?

Leak
14th August 2007, 12: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, 12:11
yes, i have tried all possible things.

buzzqw
14th August 2007, 13: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, 18: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, 19: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, 20: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, 21: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, 21: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, 21:41
Try the new version and see what happens.

smok3
19th August 2007, 13: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
19th August 2007, 23: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, 00: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, 06:26
@ Myrsloik
yep no more message no problems anymore thx :)

MatMaul
22nd August 2007, 14: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, 17: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, 19:24
done !

Myrsloik
22nd August 2007, 21: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, 16:01
thanks a lot !
I'm waiting for the new version.

MatMaul
23rd August 2007, 19: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, 19: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, 19: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, 19: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, 20: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, 20: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, 10: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, 13: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, 13: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, 08: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, 09: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, 10: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, 11: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, 20: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, 20: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, 22: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, 00:47
New version (1.10). This one actually works.

ajp
29th August 2007, 07:24
Wohoo! Tried it, it works! :D

Any chance of DTS support as well? ;)

Myrsloik
29th August 2007, 10: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, 10:10
Oh, I just assumed it didn't... never actually tried it! :D

imcold
3rd September 2007, 23:26
great plugin, thanks a lot :)

Lele-brz
5th September 2007, 11: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, 12:16
The only difference is that x264 (different versions?) produce different sized output? Nothing else?

foxyshadis
5th September 2007, 12: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, 14: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, 15:07
no the framerate wasn't changed...

I also noted some AV sync problems on other format encoding with FFmpegSource

Wilbert
5th September 2007, 19: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, 20: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, 22: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, 17: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, 19: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, 20: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, 20:22
How did seekmode=0 fail? Did you try to remux the file to mp4 and if that fails mkv?

Yong
7th September 2007, 20: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, 20: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, 21: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, 21: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, 21:54
thanks alot, no more crash on 1.11:)

Lele-brz
10th September 2007, 08: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, 21:11
Is it vfr?

Lele-brz
11th September 2007, 08: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, 10:44
But is it vfr?

Lele-brz
11th September 2007, 12: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, 20:57
Hint: timecodes=...

TheFluff
12th September 2007, 20:17
In my experience, WMV in the .wmv/ASF container is almost always VFR or some kind. vOv

Myrsloik
14th September 2007, 23: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, 07: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, 07: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, 11: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, 11: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, 12: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, 21: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, 07:27
look here http://www.64k.it/andres/dettaglio.php?sez=avisynth

BHH

Mtz
21st September 2007, 19:54
Thanks! Tried all versions and no luck. :( I think I'll reinstall my OS.

Myrsloik
6th October 2007, 21:03
New version with some minor fixes for timecodes and flv video.

Lele-brz
18th October 2007, 08: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, 00: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, 09: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, 18: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, 02:40
I want to open a DXA video in Avisynth, do I need anything else than FFMPEGSource?

Myrsloik
26th October 2007, 01: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, 13: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, 18: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.

jase99
10th March 2008, 23:31
Thanks for taking the time you already have to look into it. I'll keep an eye out tho as this will be such a huge benefit if it's ever resolved. Cheers.

SpAwN_gUy
11th March 2008, 09:46
OK. i'm moving here..

i have a demuxed from MKV 6ch .aac sound file..
as far as bassAudio is not working.. with 6ch.. i was advised to use this plugin.

with FFmpegSource with .aac as input creates cashe more than 700mb, and then i ran out of diskSpace.
with reMUXed .mp4 as input does the same.

FFaudioSource plays(tried with MPC) both streams (demuxed .aac and remuxed .mp4) with some glitches.. like skipping something.

how can i fix this? or.. any Help???

mpc plays .mp4 file just fine.. with haali's splitter and ffdshow audio decoder

Myrsloik
11th March 2008, 11:13
Don't expect perfect results without using the cache. This plugin is not for you.

dimzon
11th March 2008, 15:59
how can i fix this? or.. any Help???

mpc plays .mp4 file just fine.. with haali's splitter and ffdshow audio decoder
Just use DirecShowSource ;)

DeathTheSheep
12th March 2008, 21:15
dssource is busted with alpha 2 (latest). Is there a fixed version somewhere?

TheFluff
12th March 2008, 22:43
dssource is busted with alpha 2 (latest). Is there a fixed version somewhere?
I don't know but if there is you probably won't find it in the ffmpegsource thread.

SpAwN_gUy
13th March 2008, 16:33
Just use DirecShowSource ;)went to graphedit(i just forgot about that method) and transcoded to AC3@640kbps.. using FFdshow Audio decoder.. and ac3 output...

but the thing is.. that sound was Stereo :( ... well there were 6 channels, but... only L and R were busy...

TheFluff
13th March 2008, 19:39
You didn't happen to have the ffdshow downmixing filter active, did you?

SpAwN_gUy
14th March 2008, 10:19
You didn't happen to have the ffdshow downmixing filter active, did you?

nope... all checks - UNcheked..
Input: 48KHz, 6 channels, 117kbps SBR AAC (libfaad2)
Output (preview): 48KHz, 6 channels 16-bit integer..
current volume levels - only L and R are Jumping.. all other - 0

if connected through Nero Filtes.. ffdshow processor (connected after the decoder) shows moving also only in L and R
i guess.. it's the file...

'kay, quiting offtop...

Shinta
27th March 2008, 01:21
Hi,

I don't know if this or something equal was asked before (maybe I missed it or I'm just too lazy to search properly), anyway I'll just give it a try...

I have a mkv-video(h264) that seems to have a variable framerate (I don't know if this is possible in the container or the codec, but using the "Video Renderer" stats in MediaPlayerClassic I got something like 59.94 fps on the first 1:20 min and after that it drops 23.97 fps).

The problem should be obvious. The overall framerate gets calculated using playtime and framecount (28.53 fps). Audio and video are completely out-of-synch.

I've looked into the FFmpegSource sources (GetFrame to be precise), and saw that the seeking is done using the pure framenumbers.

Is it possible to change that to a timebased-nearest-frame something based on a virtual framerate?
(If you don't know what I mean:
When opening a file the filter searches for the two (time-)closest frame or divides framenumber and playtime to calculate the (virtual) framerate or gets a hint be the user (which I prefer).
Then it uses this framerate and the playtime to calculate a new (virtual) number of frames.
If the filter gets asked for a frame (GetFrame-Methode), it calcs the timestamp for that virtual frame using the virtual framerate, seeks to the time-closest-frame and returns it. Voila.)

Would be great if this could be implemented, I would try it myself, but still having trouble compiling ffmpeg... (though, a precompiled ffmpeg and a VS2005 project for ffmpegsource could help ;-)

Myrsloik
27th March 2008, 02:30
WRITE TIMECODES TO A FILE. Fix it yourself using that. This was also very harshly answered earlier in the thread.

For the <edit mod: removed profanity> of you trying to compile ffmpeg source this is what you need and what will happen:
A recent gcc compile like 4.2.3. Have fun compiling it yourself with mingw.
A recent ffmpeg. Straightforward IF it compiles.
Uneventfully compile zlib but forget --prefix=/mingw and confuse yourself.
Make an empty dll project in vs2005 and add all files. Also add a list of obscure gcc include libraries to appease ffmpeg.
Compile.
You are now likely to be the proud owner of a miscompiled ffmpegsource. Order a pizza and watch tv instead.

TheFluff
27th March 2008, 03:09
For the fools of you trying to compile ffmpeg source you need and what will happen:
A recent gcc compile like 4.2.3. Have fun compiling it yourself with mingw.
A recent ffmpeg. Straightforward IF it compiles.
Uneventfully compile zlib but forget --prefix=/mingw and confuse yourself.
Make an empty dll project in vs2005 and add all files. Also add a list of obscure gcc include libraries to appease ffmpeg.
Compile.
You are now likely to be the proud owner of a miscompiled ffmpegsource. Order a pizza and watch tv instead.
After successfully compiling Aegisub with ffmpeg in VS2005 (with your help) I wrote some slightly more detailed instructions (http://malakith.net/aegiwiki/Build_Instructions#ffmpeg) on how to statically link ffmpeg with something compiled in MSVC. The configure flags are not completely identical (remember to add libpostproc and its corresponding .a) and you'll need zlib as well but maybe it helps somewhat.

Shinta
27th March 2008, 19:52
@Myrsloik: Thanks for the loud and extremly confusing answer.
@TheFluff: Thx for the slightly more helpful one.

After fixing a small problem running sh-scripts with exe-extension in msys (in ./configure) and adding a missing #define to rtsp.c, I was finally able (about 3 hours) to compile ffmpeg. The compiling of ffmpegsource (I tried this using precompiled ffmpeg libs, but this results in a very small ffmpegsource.dll (292 kBytes), which was obviously crap) was just (re-)linking.

So, if someone is interessted in a VS2005 project (including ffmpegsource and zlib sources and the ffmpeg libs compiled by me), you may send me a PM.

.oO(Now, lets see, what can I do to make the filter returning frames with cfr on vfr videos)°

Shinta
28th March 2008, 17:48
Is the source at https://spaceboyz.net/svn/aegisub/trunk/FFmpegSource the current version (1.16)?
The file ffmpegsource.html holds only changelog entries until 1.14...

Also, in matroskacodecs.cpp lines 137++:

case MAKEFOURCC('Z', 'L', 'I', 'B'):
return CODEC_ID_FLV1;
case MAKEFOURCC('F', 'L', 'V', '1'):
return CODEC_ID_ZLIB;


Shouldn't this be...?:

case MAKEFOURCC('Z', 'L', 'I', 'B'):
return CODEC_ID_ZLIB;
case MAKEFOURCC('F', 'L', 'V', '1'):
return CODEC_ID_FLV1;

Myrsloik
28th March 2008, 22:16
That's a really obscure bug. Why were you reading the whole codec list anyway?

Version 1.16 + that fix is now in the svn.

Shinta
29th March 2008, 12:07
That's a really obscure bug. Why were you reading the whole codec list anyway?
I was just speed-reading the code and it caught my eye.

But another thing. I really don't understand the whole video decoding stuff completely yet, so don't be mad if I understood it wrong.

In ffmpegsource.cpp & ffmatroskasource.cpp:

// Flush the last frame
if (CurrentFrame == VI.num_frames - 1 && VideoCodecContext->has_b_frames)
Ret = avcodec_decode_video(VideoCodecContext, AFrame, &FrameFinished, NULL, 0);

Is it really only the last frame that isn't decoded at this moment? Aren't it as much as frames as the number of (deferred?) b-frames since the last seek?


// Flush the last frames
if (CurrentFrame <= VI.num_frames - 1 && VideoCodecContext->has_b_frames)
Ret = avcodec_decode_video(VideoCodecContext, AFrame, &FrameFinished, NULL, 0);


Just one thing more: In FFBase::SaveTimecodesToFile you sort the timecodes before writing them to the file. Shouldn't the frames (or their DTSs) be sorted for seeking too?

TheFluff
29th March 2008, 12:26
In ffmpegsource.cpp & ffmatroskasource.cpp:

// Flush the last frame
if (CurrentFrame == VI.num_frames - 1 && VideoCodecContext->has_b_frames)
Ret = avcodec_decode_video(VideoCodecContext, AFrame, &FrameFinished, NULL, 0);

Is it really only the last frame that isn't decoded at this moment? Aren't it as much as frames as the number of (deferred?) b-frames since the last seek?


// Flush the last frames
if (CurrentFrame <= VI.num_frames - 1 && VideoCodecContext->has_b_frames)
Ret = avcodec_decode_video(VideoCodecContext, AFrame, &FrameFinished, NULL, 0);

This makes no sense. Even if there were more than one frame, which I highly doubt (read the loop above the mentioned code again), your fix wouldn't output more than one frame because avcodec_decode_video() only outputs one frame at a time. By the way the frame that is "decoded" is just NULL, so... (see avcodec.h)

Myrsloik
29th March 2008, 13:05
Due to b-frame reordering decodign will never lag more than one frame. Example:

Shown: IBPBPI
Stored: IPBPBI

Shown: IBBPBBPI
Stored: IPBBPBBI

Meaning that you will never have more than a one frame lag (indicated by has_b_frames). Thus there are no more frames to flush. As thefluff pointed out that part is also only triggered if all the other logic failed which is for the last frame with decoding lag OR for very unusual decoding errors and then only for the last frame.



FFBase::SaveTimecodesToFile - The whole DTS relation is a bit special. That function only sorts them because mkvmerge expects it as input (historical note: old versions used unsorted).

The reason ffmpegsource doesn't care about it being sorted or not is that the position of keyframes is independent of the reordering. As the only value extracted from it is "what frame number does this DTS correspond to?" and we know that seeking always goes to keyframes (minus bugs and that stuff). So the only thing the other DTS values in between are really used for are placeholders.

Shinta
29th March 2008, 13:06
For videos with only one b-frame your right, but I found a video that seems to have 2 frames left to decode after reaching EOF.

Using this code...

// Flush the last frames
if (CurrentFrame <= VI.num_frames - 1 && VideoCodecContext->has_b_frames)
Ret = avcodec_decode_video(VideoCodecContext, AFrame, &FrameFinished, NULL, 0);

FILE* err=fopen("err.txt", "a");
if(err)
{
fprintf(err, "%d %d %d %d %d\r\n", CurrentFrame, VI.num_frames-1, Ret, FrameFinished, VideoCodecContext->has_b_frames);
fclose(err);
}


I got this err.txt:

90286 90287 0 200 2
90287 90287 0 200 2


I don't know what the 200s in the 4th column means exactly, but they're not zero and thus the frame were decoded.

Myrsloik
29th March 2008, 13:37
To debug these things it's usually much easier to encode a clip with similar settings and clearly number every frame. Does your clip by any chance have open GOPs?

Shinta
29th March 2008, 13:55
Maybe it has something to do with this:

(From the german wikipedia on h264)

Long-Term Prediction: P- und B-Frames können nicht nur Referenzen auf den jeweils letzten I- oder P-Frame enthalten, sondern auch zu theoretisch beliebig vielen vorhergehenden, um eine effizientere Kodierung von periodischen Bewegungen zu ermöglichen. In den Profiles und Levels ist die Anzahl von Referenzbildern allerdings auf maximal fünf begrenzt.


My translation (hope it is good enough):

Long-Term Prediction: P- and B-frames doesn't have to reference only the last I- or P-frame, but also to theoreticaly any number of previous (I- or P-)frames, to increase encoding performance on recurring movements. The profiles and levels limits the number of referenced frame to five.



To debug these things it's usually much easier to encode a clip with similar settings and clearly number every frame. Does your clip by any chance have open GOPs?


I don't know, and don't know how to find that out. But I've splitted the video at the last keyframe and can send you this 74 kByte mkv.

Shinta
29th March 2008, 14:13
Lets try an attachment: (it is that 74kb mkv)

Myrsloik
29th March 2008, 14:26
Seeking in h264 should be limited to IDR frames which means the assumption is still true (I is just another letter in between). Find some place to upload the file to and I will look at it.

Shinta
29th March 2008, 14:36
Or, http://www.megaupload.com/?d=Y9QNAHQB

Manao
29th March 2008, 21:39
The one-frame lag implied by bframes is valid for all codecs prior to H264. For h264, the possibility to create b-reference (and thus pyramidal b-gops) may create longer lags (one level of byramid is commonly used with x264 and creates a two frame lag)

Myrsloik
30th March 2008, 16:42
Bug fixed and put in the svn. As Manao hinted it only applied to h264 with pyramid stuff and would usually result in the last frame being dropped and the now second to last frame duplicated.

No new compile today though, ffmpeg svn is having one of those broken weeks it seems.

thetoof
31st March 2008, 01:28
Feature request: handling of the anamorphic flags

Myrsloik
31st March 2008, 17:50
So I've read the AR from the stream, now what? Return it in a variable with a user specified name? Rescale the video and kill kittens?

jase99
2nd April 2008, 19:53
I regularly use the filter with anamorphic sources, what additional support is needed?

Myrsloik
4th April 2008, 16:30
How aspect ratio reporting is done now:
FFSAR_NUM, FFSAR_DEN and FFSAR are set to the container values for mkv and the video decoder values for all other filetypes.
The problem:
Several mp4 files report a SAR of 0/1 which isn't right or very helpful. Should the cases with 0 be converted to 1/1 or left as it is?

IanB
4th April 2008, 23:33
You are probably better reporting exactly what is in the container. People can then devise what ever is best for them. If you implemet any scheme then you hide information, i.e. is it really 1/1 or did Myrsloik convert 0/1 to 1/1.

Myrsloik
4th April 2008, 23:49
New version posted (1.17) which fixes decoding of the last frames in h264 and adds reporting of the SAR for the currently decoded clip.

buzzqw
5th April 2008, 08:10
seems that last version break vc1 support
with previus versione (1.16) i was able to open m2ts file using this string
FFmpegSource("part0022_vc1.m2ts",vtrack=-1,atrack=-2,seekmode=-1,timecodes="Test.timecodes",vcache=true,vcachefile="Test.ffcache")

but now i got a failure on opening script with virtualdub

here is a sample http://www.mediafire.com/?crgnxmvzpzy of m2ts (60mb)

thanks!

BHH

Myrsloik
5th April 2008, 10:35
Fixed in 1.18. Obviously lavc returns lots of errors when decoding that kind of clip. All errors are once again ignored.

buzzqw
5th April 2008, 11:05
yes, working!

:thanks:

BHH

Nagisa_chan
7th April 2008, 16:32
I have one question

Is FFmpegSource better than DirectShowSource?

I am novice

the people "not here" says :directshowsource is shit

IanB
7th April 2008, 23:21
What ever works is better :)

DirectShowSource use Micro$ofts DirectShow media player API to attempt to strip Video and Audio from media for processing. The DirectShow API's goals are to support DRM, make writing Media Player easy and playback media smoothly, none of which Avisynth particularly needs. The API does not mandate sample exact positioning or maximum speed and quality decoding, both of which are highly desirable for Avisynth usage.

FFMpeg provides source decoders for many formats to the DirectShow interface. FFMpegSource accesses those source decoders before DirectShow gets it's grubby little paws in the mix, so hopefully can provide better control over the media data being extracted. But remember as the target audience is DirectShow some source decoders do not implement the features like sample exact positioning that Avisynth requires, so decoding some formats can still be problematic.

When decoding media in Avisynth you should look for a native source decoder first, like AviSource, MPeg2Source, QTSource, Nic*Source, etc. If none are available then look for the better generic media decoders like FFMpegSource. If still none are available then you may have to use DirectShowSource, for many formats it is the only choice available and for some formats it even does a very excelent job.

As I said "What ever works is better".DirectShowSource is shitIn many case yes, but please remember and explain to people that it is always doing the best that it can with an API that is sometime antagonistic about striping media.

vlada
8th April 2008, 20:02
Hi,

I'm working on an automated transcoding application. One of the tasks I need to do when opening a video is cropping detection. If I open a DVD disc (VOB file), the indexing takes a very long time. To detect letterbox, I don't need frame accurate seeking (I guess this is what the indexing is good for). Is there any way to disable the indexing?

I could use DirectShowSource, but I would like to use FFmpegSource, because it is independant on what the user has installed.

buzzqw
9th April 2008, 07:12
@vlada

dont' want to bother.. but mplayer.exe has a good detect crop rountines... you can use it for determining crop values
mplayer.exe -vf cropdetect -nosound -vo null -frames 15 -sstep XXX inputfile.vob

where xxx is the totaly duration of movie in sec / 15

BHH

Myrsloik
9th April 2008, 16:03
Alternatively compile ffmpeg with only the mpeg2/vob parts and link it into your program. Using ffmpeg directly isn't that hard and will be a lot easier than convincing me to add that "feature".

vlada
10th April 2008, 13:00
Thanks for the suggestions.

I will stay with Avisynth and ffmpeg source for now. I need to index the files for conversion anyway. But after completing the first half of my project (build a universal anything -> DVD/AVI/MP4/MKV convertor) I plan to transform my application into a NLE.

One of the basic features I plan to implement is "Direct Stream Copy". So I will need mencoder or ffmpeg for this anyway. But I'm still very far away from this. Also my programming knowledge is still very low.

Nagisa_chan
13th April 2008, 12:17
Thanks for the reply:)

CruNcher
17th April 2008, 17:32
@Myrsloik

Somehow the Framerate of .WMV files are wrong detected i allways have to use Assumefps to correct that :(
going over directshowsource works via ffdshow and microsofts decoder both detect the framerate correctly.
Tough that is only a small problem :) keep on the source filter is great.

Would it be possible to parse the H.264 bitstream (for all container) and look if Pulldown has been used (HD-DVD) and according to that set the correct fps :) (would make transcoding life another step easier currently ffmpegsource detects it allways as 29.97 fps

Myrsloik
17th April 2008, 18:58
Framerate for all containers except mkv is determined by the time delta between the first and the second frame and nothing more. For cfr files it works great, for vfr it works not so great.

Summary: it's vfr so you should be writing out the timecodes anyway because avisynth doesn't support vfr.

Pulldown support is extremely unlikely to be added because of how it would have to be implemented. There is no way to retrieve that information from the libavformat parsers and instead the video has to be fully decoded which would make the indexing ridiculously slow. Finding out whether pulldown flags exist at all would also most likely require the whole video to be decoded.

vlada
17th April 2008, 23:07
Hello,

I have another couple of questions. The first problem is nubering of audio tracks. I want to transcode audio track(s) from a DVD-Video using FFmpegSource and SoundOut. Using MediaInfo I dtected that the first audio track has ID 80. But if I used atrack=80, FFmpegSource returned an error that this not an audio track. Using atrack=1 works fine. So how are the audio tracks IDs treated? Right now it seems to me that the first track (0) is video and nex tracks (starting from 1) are audio. Is this correct?

Second question - what is the audio caching good for? It takes quite a long time to complete. Why isn't the audio decoded "on-the-fly"?

As I already wrote I'm working on a simple to use program based on Avisynth. It should be able to convert between most popular formats. FFmpegSource is really great for my needs. It doesn't rely on installed codecs or filters and I can specify which audio track to process.

The problem is that during indexing or caching of audio the program seems to be freezed, because I have no idea how to check and display the progress of indexing. Is there any possibility to do it?

Myrsloik
17th April 2008, 23:23
This is all you will ever know about track numbering because there is no real system to it: (coincidentally it's also in the manual)
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.

Find out for yourself why audio caching is a good idea:
FFAudioSource(string source, int atrack = -1, string acachefile, string ademuxedfile)

Experimental, may or may not be accurate enough for real usage.

And no, there is no sane way for avisynth filters to show creation progress.

CruNcher
20th April 2008, 22:51
@Myrsloik

http://forum.doom9.org/showthread.php?p=1127362#post1127362

Myrsloik
20th April 2008, 23:13
A link for me? you really shouldn't have...

It says mplayer parsers work but libavformat fails? do I do something now? should I panic? what's the mbaff stuff about? is that what makes it fail and not the parsers? was the point that mplayer patches ffmpeg until it can no longer be recognized as usual?

Don't panic

CruNcher
20th April 2008, 23:52
I'm not sure why ffmpegsource fails with those files it just doesn't do anything anymore it seems i see no cache created nothing seems to happen, the application just freezes and almost the whole Windows does when i execute the .avs (it looks like a buffer overflow), but without the mbaff patch it should react like videolan i guess and show these decoding errors and not crash immediately or hang in a loop.

It seems only when MPC-HC is trying to open that .avs the whole system almost freezes when x264.exe does i see io activity seems like indexing is in progress for the 2 gb file now

jep it works now from x264.exe as it should with the .ts one

avis [info]: 1280x720 @ 23.97 fps (15016 frames)
x264 [info]: using cpu capabilities: MMX MMXEXT SSE SSE2 SSE3 3DNow!
[h264 @ 01968E20]warning: first frame is no keyframe
encoded frames: 2899/15016 (19.3%), 15.68 fps, eta 0:12:52

ok i updated it everything works except MPG (the same case as for Mplayer which isn't suprising since both use libavformat and are up2date) :)

@ Myrsloik
another problem occurred I created from a TS file 23.976 FPS a .MKV and .MP4 with Haalis Dsmux and both seem either being wrong detected or Haalis muxer does something wrong :(

Input TS information


General #0
ID : 0
Complete name : C:\x264hardware\test.ts
Format : MPEG-4 Transport
Format/Family : MPEG-4
File size : 1.98 GiB
PlayTime : 10mn 26s
Bit rate : 27.1 Mbps

Video #0
ID : 4113 (0x1011)
MenuID/String : 1 (0x1)
Codec : AVC
Codec/Family : AVC
Codec/Info : Advanced Video Codec
Codec profile : High@L4.1
Codec settings, CABAC : Yes
Codec_Settings_RefFrames : 2
PlayTime : 10mn 26s
Bit rate : 26.1 Mbps
Width : 1920 pixels
Height : 1080 pixels
Display Aspect ratio : 16/9
Frame rate : 23.976 fps
Chroma : 4:2:0
Interlacement : Progressive


the initial TS is exactly 23.976 Film (all applications detect it as such)


MKV:


General #0
Complete name : C:\x264hardware\test.mkv
Format : Matroska
File size : 1.93 GiB
PlayTime : 10mn 27s
Bit rate : 26.5 Mbps
Encoded date : UTC 2008-04-21 13:04:09
Writing application : dsmux
Writing library : Haali DirectShow Matroska Muxer 1.8.122.18

Video #0
Codec : AVC
Codec/Family : AVC
Codec/Info : Advanced Video Codec
Codec profile : High@L4.1
Codec settings, CABAC : Yes
Codec_Settings_RefFrames : 2
PlayTime : 10mn 26s
Bit rate : 25.4 Mbps
Width : 1920 pixels
Height : 1080 pixels
Display Aspect ratio : 16/9
Frame rate : 23.976 fps
Chroma : 4:2:0
Interlacement : Progressive



MP4:

General #0
Complete name : C:\x264hardware\test.mp4
Format : QuickTime
Format/Info : Original Apple specifications
Format/Family : MPEG-4
File size : 1.93 GiB
PlayTime : 10mn 27s
Bit rate : 26.5 Mbps
Encoded date : UTC 2008-04-21 13:33:00
Tagged date : UTC 2008-04-21 13:33:00

Video #0
Codec : AVC
Codec/Family : AVC
Codec/Info : Advanced Video Codec
Codec profile : High@L4.1
Codec settings, CABAC : Yes
Codec_Settings_RefFrames : 2
PlayTime : 10mn 27s
Bit rate : 43.9 Mbps
Maximum bit rate : 26.5 Mbps
Width : 1920 pixels
Height : 1080 pixels
Display Aspect ratio : 16/9
Frame rate mode : VFR
Frame rate : 23.939 fps
Minimum frame rate : 0.999 fps
Maximum frame rate : 23.976 fps
Chroma : 4:2:0
Interlacement : Progressive
Bits/(Pixel*Frame) : 0.885
Encoded date : UTC 2008-04-21 13:33:00
Tagged date : UTC 2008-04-21 13:33:00




FFMPEGsource parsing results

TS = avis [info]: 1920x1080 @ 23.97 fps (15016 frames) - the first frames are non key frames tough ffmpegsource doesn't skip them
MKV = avis [info]: 1920x1080 @ 23.94 fps (15014 frames) - starts with the keyframe (correct)
MP4 = avis [info]: 1920x1080 @ 23.98 fps (15014 frames) - starts with the keyframe (correct)

how can this be ???

vlada
3rd May 2008, 14:37
I have an MKV file with 2 audio tracks: MP3 and Vorbis. It is a short sample I made for testing my application.

FFmpegSource has problems reading audio from this file. I use command FFAudioSource("video.mkv", ademuxedfile = "demuxed.ac3", atrack=1, acachefile="temp"). For the first audio track (MP3) no demuxed file is created, but the audio is handled to the output. For the second track (Vorbis) the audio is not even passed to the output. It is probably normal for Vorbis tracks that they can't be demuxed.

I tried to demux the file with ffmpeg. It demuxes the MP3 correctly but fails with the Vorbis track. It is a general problem with MKV/Vorbis files (I tested it on other videos I have). Reencoding the Vorbis audio track to other format works correctly.

I'm wondering why FFmpegSource won't read the Vorbis track at all and why it won't demux the MP3 file. Do you have any idea?

Myrsloik
13th May 2008, 15:43
Don't use ademuxedfile for actual demuxing (bad argument name). It's not meant to be used that way and is only written when actually needed for decoding.

No idea why vorbis would fail but as the manual says FFAudioSource is very experimental.

Blue_MiSfit
15th May 2008, 20:26
Well, I love the fact that ffmpegsource seems to be frame accurate, and doesn't rely on DirectShow!

However, building the indexes is very slow on (for example) a 15GB HD-DVD or BluRay -> MKV remux (I've been working on a lot of these). Is there any way to index ahead of time? i.e. before I actually fire up AVSp, write an FFMPEGSource(...) script and hit F5 - then wait while the app hangs for 10 minutes or so while it builds the index? Maybe someone could cobble together a DGIndex workalike - nothing complex - just a little GUI or even a CLI app to show you that yes in fact, indexing is happening.

I ask for too many things :) If I could code, I could give. I should do something about that.

~MiSfit

Myrsloik
15th May 2008, 20:46
So what you want is either a (command line?) program that starts the indexing process so it can run in the background OR that it shows a progress bar when opening files? Both should be fairly easy to do after I get around to making indexing a separate pass which I plan to anyway. Not that I will have time to make it happen until sometime in 2011 with my schedule though...

asdfsauce
15th May 2008, 21:25
I was going to ask for this too (command line), but didn't think anyone else would be interested in that. I'm working on an avisynth based encoder and things would be more seamless if files were indexed beforehand.

Another thing I had to say was when I merge one file with using one source and then merge it with a file using ffmpegsource, when playback reaches the ffmpegesource clip it becomes really laggy, whereas it would play fine by itself. Any ideas on what may be going on?

Myrsloik
15th May 2008, 21:27
The only reason I can think of would be audio (aligned/unaligned splice) doing something odd. If you don't have audio in the clips then I really have no idea why it happens.

vlada
17th May 2008, 04:55
Don't use ademuxedfile for actual demuxing (bad argument name). It's not meant to be used that way and is only written when actually needed for decoding.

So I guess I'd better use mkvextract, AVI-Mux GUI, DGIndex and MP4Box for demuxing, right?

Btw. I'd be interested in the CLI indexer with progress indicator too.

asdfsauce
What kind of application are you working on? Maybe we exchange some ideas and experiences because I'm working on an Avisynth based transcoder too. I'm using PyGTK and currrently my application is able to take any input (including DVD), automatically set the best possible parameters (size, resolution etc.) and convert it to AVI/MPEG-4 ASP.

Sorry for this OT.

asdfsauce
17th May 2008, 16:26
The only reason I can think of would be audio (aligned/unaligned splice) doing something odd. If you don't have audio in the clips then I really have no idea why it happens.

I figured it out, thanks. Had nothing to do with FFMPEGSource. :)


asdfsauce
What kind of application are you working on? Maybe we exchange some ideas and experiences because I'm working on an Avisynth based transcoder too. I'm using PyGTK and currrently my application is able to take any input (including DVD), automatically set the best possible parameters (size, resolution etc.) and convert it to AVI/MPEG-4 ASP.

Sorry for this OT.

Cool, I'll PM you about it.

Myrsloik
31st May 2008, 10:21
Version 1.19 released. It's only a an evolutionary update with a newer ffmpeg and a filter that allows swscale to be used for colorspace conversions/resizing separately. It also autodetects the number of threads to use for decoding and exports a few more values of questionable importance.

rhester72
4th June 2008, 03:43
Any hope for AC3-in-AVI? If your plugin supported that, I could ditch DirectShowSource entirely. :)

Rodney

cweb
4th June 2008, 07:13
Any hope for AC3-in-AVI? If your plugin supported that, I could ditch DirectShowSource entirely. :)

Rodney
There's nicac3source for that already...

rhester72
4th June 2008, 13:40
True enough, but that requires a manual demux and handlers for every container type, which rather defeats the purpose of having something like FFmpegSource to begin with.

Rodney

Myrsloik
4th June 2008, 14:34
Would you consider donating a sample file to the cause? I seem to have run out of ac3 in avi files recently.

rhester72
4th June 2008, 15:16
Certainly:

http://www.mediafire.com/?m1drsc2wjvn (10.64MB)

Rodney

Atak_Snajpera
11th June 2008, 00:27
I have a problem with FFmpegSource with mkv (avc). I use this script in my app in order to get some info from source. The problem is that I get incorrect framerate (24.07 instead of 23.976). If I use DirectShowSource everything is ok and I get correct 23.976 value.

LoadPlugin("C:\Users\Dawidos\Desktop\RipBot264v1.9.8\Tools\AviSynth plugins\FFmpegSource\FFmpegSource.dll")
video=FFmpegSource("C:\Users\Dawidos\Desktop\1.mkv",vcachefile="C:\Temp\RipBot264temp\job1\FFmpegSource.cache").ConvertToYV12()
LoadPlugin("C:\Users\Dawidos\Desktop\RipBot264v1.9.8\tools\AviSynth plugins\NicAudio\NicAudio.dll")
audio=NicAC3Source("C:\Temp\RipBot264temp\job1\audio.1.ac3")
AudioDub(video,audio)
WriteFile("C:\Temp\RipBot264temp\job1\info.txt","Framecount")
WriteFile("C:\Temp\RipBot264temp\job1\info.txt","Framerate")
WriteFile("C:\Temp\RipBot264temp\job1\info.txt","AudioRate")
WriteFile("C:\Temp\RipBot264temp\job1\info.txt","AudioChannels")
WriteFile("C:\Temp\RipBot264temp\job1\info.txt","AudioLength")
WriteFile("C:\Temp\RipBot264temp\job1\info.txt","Width")
WriteFile("C:\Temp\RipBot264temp\job1\info.txt","Height ")
Trim(0,-1)

sample
http://www.mediafire.com/?egp0ldqwgxi

martino
11th June 2008, 01:33
Don't think there's anything wrong with it. The MKV probably has timecodes (I haven't checked myself) where not all timestamps are the same (implying it not being CFR) and it does some sort of averaging on the overall framerate, maybe?

tebasuna51
11th June 2008, 16:07
Don't think there's anything wrong with it. The MKV probably has timecodes (I haven't checked myself) where not all timestamps are the same (implying it not being CFR) and it does some sort of averaging on the overall framerate, maybe?

Checking the Atak_Snajpera sample I found this data from MediaInfo and TimeCode_Track2.txt (MKVextract):
MEDIAINFO:
General
Duration : 21s 696ms

Video
Duration : 21s 666ms
Frame rate : 23.976
FrameCount : 520

Audio
Duration : 21s 696ms
----------------------------------
Timecodes:
0.000000 # frame 0
42.000000
83.000000
...
21605.000000
21647.000000 # frame 519

With these data I can obtain different frame rate calculations:

Theoretic:
24000 / 1001 = 23.976024

Using FrameCount and Duration (General&Audio or Video)
520 / 21.696 = 23.967551 # error = 0.00847
520 / 21.666 = 24.000738 # error = -0.02471

Using Timecodes
(with 1 ms precision the FrameCount limit the fps precision)
519 / 21.646 = 23.976716 # error = -0.00069
519 / 21.647 = 23.975608 # error = 0.00041 best approach
519 / 21.648 = 23.974501 # error = 0.00152


But never something like 24.069126 # error = -0.093102
obtained with ffmpegSource.

Edit: Timecodes obtained with FFmpegSource identical to obtained with MKVextract

Myrsloik
11th June 2008, 22:09
Not a bug, documented behavior and MATROSKA DOES NOT HAVE A FRAMERATE. That last part should be repeated as often as possible since lots of people waste their time looking for it. What is returned is just (number of frames - 1)/(last dts - first dts) which FOR CFR FILES WILL BE FAIRLY CLOSE.

tebasuna51
12th June 2008, 00:24
...
What is returned is just (number of frames - 1)/(last dts - first dts)
...

Yes, this was expected, but in the sample:

(number of frames - 1)/(last dts - first dts)
519 / 21.647 = 23.975608 # error = 0.00041 best approach

and not 24.069126 # error = -0.093102
obtained with the Atak_Snajpera avs.

Myrsloik
12th June 2008, 12:18
Is it noticable? Is this even a meaningful discussion?

You take a rational value, round it to a fixed point number to store as a timestamp and then expect the actual rational number to be recoverable. Good luck with that.

If you know that much I can only recommend assumefps() from the start. Anything else will only disappoint you. And if you say "make a special case" I will say "write the function yourself to detect it".

Atak_Snajpera
12th June 2008, 23:06
if you know that much I can only recommend assumefps() from the start.

I've already done that

LoadPlugin("C:\Users\Dawidos\Desktop\RipBot264v1.9.8\Tools\AviSynth plugins\FFmpegSource\FFmpegSource.dll")
video=FFmpegSource("C:\Users\Dawidos\Desktop\1.mkv",vcachefile="C:\Temp\RipBot264temp\job1\FFmpegSource.cache").ConvertToYV12().Assume(value_taken_from_MediaInfo)
LoadPlugin("C:\Users\Dawidos\Desktop\RipBot264v1.9.8\tools\AviSynth plugins\NicAudio\NicAudio.dll")
audio=NicAC3Source("C:\Temp\RipBot264temp\job1\audio.1.ac3")
AudioDub(video,audio)
WriteFile("C:\Temp\RipBot264temp\job1\info.txt","Framecount")
WriteFile("C:\Temp\RipBot264temp\job1\info.txt","Framerate")
WriteFile("C:\Temp\RipBot264temp\job1\info.txt","AudioRate")
WriteFile("C:\Temp\RipBot264temp\job1\info.txt","AudioChannels")
WriteFile("C:\Temp\RipBot264temp\job1\info.txt","AudioLength")
WriteFile("C:\Temp\RipBot264temp\job1\info.txt","Width")
WriteFile("C:\Temp\RipBot264temp\job1\info.txt","Height ")
Trim(0,-1)

vlada
16th June 2008, 17:10
I have a problem with the latest FFmpegSource (version 1.19). I'm getting this error:

Avisynth error:

Script error: FFAudioSource does not have a named argument "ademuxedfile"

Was this parameter removed? I can use "acachefile", it just looks to me that demuxing audio file is much faster then decoding and caching the whole audio track.

Myrsloik
16th June 2008, 20:29
It was renamed to acachefile2 to obfuscate it. I also managed to omit it in the changelog.

And now for a general service announcement: I am a cheap bastard. What this means for you (forum readers, dvd collection backupers and all you people who get mkvs from the internet that I have to pretend don't exist) is that my webhosting will stop being free any day now. Since I'm extremely cheap I also won't bother to buy hosting elsewhere until it really stops working. (stops working is defined by not being available for a few weeks)

vlada
17th June 2008, 00:02
So is there a reason why I shouldn't use acachefile2? I'm not using it for real demuxing anymore, as you have suggested. But the decoding (caching) takes really long time and I can't even show a progress dialog for it.

Thinking about it, it might be faster to use a CLI demuxer (ffmpeg, mp4box, mkvextract etc.) and then use NicAudioSource to open the audio files. But will be a much more work (programming) for me. Is the audio caching really so important? Couldn't it be avoided (I know I've asked it before)? I understand it might be important for editing, but I'm only interested in transcoding so far.

Myrsloik
18th June 2008, 08:54
If you shouldn't be using it at all it wouldn't be there. You're also right that decoding to wav/piping with ffmpeg.exe will do exactly what you want since you only need to access the audio linearly.

AnnaFan777
24th June 2008, 17:03
Hi, I found some flvs cannot be opened with ffmpegsource
but can play it with winpyflv players..
would you take a look?
thanks..

http://www.cloudgate.org.tw/event/2007/spring_present/flv/
http://www.cloudgate.org.tw/event/2007/spring_present/flv/oculus_150s.flv

Myrsloik
24th June 2008, 22:25
WhileI can't look at the files right now or anytime soon my guess is that the video itself is encoded in a way that's not yet supported by ffmpeg. FLVs can contain a few different combinations (exactly which i can't remember right now). Try again later or try it with a recent compile of ffplay.exe and see if it works there.

Malow
8th July 2008, 14:55
how ffmpegsource handle the color matrix from mpeg2?

the output from a xdcam ex video (mpeg2) become Rec.601, i have to use colormatrix to convert to Rec.709 and make colors right.

edit: WOOOOPS, my bad. i was using a "experimental" import plugin for sony vegas, and it was not making the correct tranfer.

the problem was the plugin, not ffmpegsource.. ;)

Malow
9th July 2008, 06:55
im having another weird thing (but now is not my fault ;) )

opening xdcam ex mp4 file (mp4 with mpeg2+pcm) it lost 2 frames on video start and repeat twice the last frame, like the video was "slipped" to the right.

ffmpeg.exe doesnot cause this...

Myrsloik
9th July 2008, 07:24
Does it also happen when you use seekmode=-1? Unfortunately I'll still be away from my real computer for a few more weeks so I can't do any testing/debugging right now.

Malow
9th July 2008, 10:08
im doing alot of testing, this is what ive got so far:

carbon coder and vegas works perfect, get all frames, no cut/dupes. (with mp4 wrapped to mxf)

in one example, ffmpegsource cuts the 2 first frames, and duplicate the last one two times (making the framecount correct)

ffmpeg.exe cut the 2 first frames also, but instead of duplicate the last two it duplicate the first (after the 2-frame cut)

the same happens with the wrapped mxf.

so ive demuxed the mp4, and looks like the problem is in the mpeg-2 video. looks like the video does not start with a keyframe (its possible?) and dgmpeg/ffmpeg/virtualdub skip the start of video to the third frame. vdub show as being an i-frame.

looks like the video from these cameras are not so friendly. the mp4 looks "non-standard", as basicaly no splitter works with it (besides ffmpeg).

ive tried all options/combinations and the result are the same...

i believe theres nothing to do about it.. :(

Blue_MiSfit
10th July 2008, 23:39
I'm having a tricky time with 1080i VC1 and ffmpegsource!

See my thread here for more details:
http://forum.doom9.org/showthread.php?t=139340

Basically, the source is a BluRay disc, dumped to a video-only MKV. When I open with ffmpegsource the indexing takes ages (of course ;)), and before it finishes, the avsP error log starts spewing all kinds of nonsense, and the application totally hangs. I close and re-open, and indexing starts all over :(

Ideas?
~MiSfit

vlada
11th July 2008, 00:29
AFAIK libavcodec doesn't support interlaced VC-1 so it is no wonder it crashes.

Blue_MiSfit
11th July 2008, 01:32
Figured as much :(

~MiSfit

CruNcher
12th July 2008, 10:36
@Myrsloik

i converted .WMV entirely to .MKV now the problem is FFMPEGSource seems to have problems with those files :( every seekmode crashes after the encoding is finished and it only displays this

[matroska @ 01A66DC8]Unknown seekhead ID 0xbf
[matroska @ 01A66DC8]Ignoring seekhead entry for ID=0x1549a966
[matroska @ 01A66DC8]Ignoring seekhead entry for ID=0x1654ae6b
[matroska @ 01A66DC8]Unknown entry 0xbf in cues header
[matroska @ 01A66DC8]Unknown entry 0xbf in info header
[matroska @ 01A66DC8]Unknown entry 0x73a4 in info header
[matroska @ 01A66DC8]Unknown entry 0xbf in track header
avis [info]: 1280x528 @ 23.98 fps (3633 frames) <- 1 Frame got missing

http://s1.directupload.net/images/080712/44vs8enp.jpg

VLC,Mplayer and Gabest Source filter have no Problem with this file (Haalis own has Sync issues) :(

Converted (MKV):

General
Complete name : D:\x264test\vegas.mkv
Format : Matroska
File size : 36.0 MiB
Duration : 2mn 31s
Overal bit rate : 1986 Kbps
Encoded date : UTC 2008-07-12 09:04:02
Writing application : gdsmux
Writing library : Haali DirectShow Matroska Muxer 1.8.122.18

Video
Format : VC-1
Codec ID : WVC1
Codec ID/Hint : Microsoft
Width : 1280 pixels
Height : 528 pixels
Display aspect ratio : 2.424
Resolution : 24 bits
Language : English

Audio
Format : WMA2
Codec ID : 161
Codec ID/Info : Windows Media Audio 2
Duration : 2mn 31s
Bit rate : 128 Kbps
Channel(s) : 2 channels
Sampling rate : 44.1 KHz
Resolution : 16 bits
Language : English


Original (WMV):

General
Complete name : D:\x264test\Vegas_1280x528.wmv
Format : Windows Media
File size : 36.1 MiB
Duration : 2mn 31s
Overal bit rate mode : Variable
Overal bit rate : 1999 Kbps
Maximum overal bit rate : 2013 Kbps
Movie name : What Happens in Vegas
Encoded date : UTC 2008-03-13 23:08:59.613
Copyright : 2008 Fox

Video
Format : VC-1
Format profile : AP@L2
Codec ID : WVC1
Codec ID/Hint : Microsoft
Duration : 2mn 31s
Bit rate mode : Variable
Bit rate : 1863 Kbps
Width : 1280 pixels
Height : 528 pixels
Display aspect ratio : 2.424
Frame rate : 23.976 fps
Resolution : 24 bits
Bits/(Pixel*Frame) : 0.115

Audio
Format : WMA2
Format profile : L3
Codec ID : 161
Codec ID/Info : Windows Media Audio 2
Duration : 2mn 31s
Bit rate mode : Variable
Bit rate : 128 Kbps
Channel(s) : 2 channels
Sampling rate : 44.1 KHz

hope you can look into this (if you back) :)

maybe your used Libavformat is to old in 1.19 now ?

Myrsloik
12th July 2008, 13:30
Libavformat isn't used for matroska, haali's library is. Since you say haali's splitter also has problems with it you should probably show the file to haali and see what he says first.

CruNcher
12th July 2008, 23:14
@Myrsloik
are you sure you useing Haalis libraries from the output i get

[matroska @ 01A66DC8]Unknown seekhead ID 0xbf
[matroska @ 01A66DC8]Ignoring seekhead entry for ID=0x1549a966
[matroska @ 01A66DC8]Ignoring seekhead entry for ID=0x1654ae6b
[matroska @ 01A66DC8]Unknown entry 0xbf in cues header
[matroska @ 01A66DC8]Unknown entry 0xbf in info header
[matroska @ 01A66DC8]Unknown entry 0x73a4 in info header
[matroska @ 01A66DC8]Unknown entry 0xbf in track header

it looks like libavformat to me ? could it be that it falls back to it, i can't find any reason for it on my side (another loaded ffmpegsource) or something of that kind im useing your latest released FFMPEGSource 1.19 3,68 MB (3.862.528 Bytes)
i talked with Haali and he also confirmed his parser would never show these information that's ffmpeg typical debug output, so im suprised over here what's going on, maybe the combination libavcodec and haalis parser isn't compatible in this case ?

TheFluff
13th July 2008, 00:07
@Myrsloik
are you sure you useing Haalis libraries from the output i get

[matroska @ 01A66DC8]Unknown seekhead ID 0xbf
[matroska @ 01A66DC8]Ignoring seekhead entry for ID=0x1549a966
[matroska @ 01A66DC8]Ignoring seekhead entry for ID=0x1654ae6b
[matroska @ 01A66DC8]Unknown entry 0xbf in cues header
[matroska @ 01A66DC8]Unknown entry 0xbf in info header
[matroska @ 01A66DC8]Unknown entry 0x73a4 in info header
[matroska @ 01A66DC8]Unknown entry 0xbf in track header

it looks like libavformat to me ? could it be that it falls back to it, i can't find any reason for it on my side (another loaded ffmpegsource) or something of that kind im useing your latest released FFMPEGSource 1.19 3,68 MB (3.862.528 Bytes)
i talked with Haali and he also confirmed his parser would never show these information that's ffmpeg typical debug output, so im suprised over here what's going on, maybe the combination libavcodec and haalis parser isn't compatible in this case ?
I... what? No seriously, WTF?

Since you apparently love copypasting gigantic walls of text I'll just go ahead and do the same...
From ffshared.cpp, function CreateFFmpegSource():
if (av_open_input_file(&FormatContext, Source, NULL, 0, NULL) != 0)
Env->ThrowError("FFmpegSource: Couldn't open %s", Args[0].AsString());
bool IsMatroska = !strcmp(FormatContext->iformat->name, "matroska");
av_close_input_file(FormatContext);

if (IsMatroska) {
return new FFMatroskaSource(Source, VTrack, ATrack, Timecodes, VCache, VCacheFile, ACacheFile, PPString, PPQuality, Threads, Env);
} else {
// Do a separate indexing pass, enjoy the constructor sideeffects
if (SeekMode == -1)
delete new FFmpegSource(Source, VTrack, ATrack, Timecodes, VCache, VCacheFile, ACacheFile, PPString, PPQuality, Threads, -2, Env);
return new FFmpegSource(Source, VTrack, ATrack, Timecodes, VCache, VCacheFile, ACacheFile, PPString, PPQuality, Threads, SeekMode, Env);
}
As you may or may not have guessed, FFMatroskaSource() calls no libavformat functions whatsoever.

What I'm guessing happens is that you get those errors from libavformat when the file is first opened to check if it's a Matroska file or not, and Haali's parser then fails on it because the file is broken in one way or another. Go back and do your homework, do not pass GO and do not collect your $200 salary.

(Seriously why do I even have to explain this? You noted in your original post that Haali's splitter has issues with this file when used as standalone, what makes you think it won't have issues when used from ffmpegsource? Magic?)

CruNcher
13th July 2008, 07:14
@TheFluff

Yeah in that case it's clear where that debug output comes from i didn't suspect that the file is parsed first by libavformat to confirm that it is indeed Matroska, thought it's decided by the file extension, so yeah we have to wait for Haali checking this file on Monday and most probably fixing the libraries :(. Im useing FFMPEG as long as this isn't fixed in the meantime for these problematic files.


(Seriously why do I even have to explain this? You noted in your original post that Haali's splitter has issues with this file when used as standalone, what makes you think it won't have issues when used from ffmpegsource? Magic?)


Yeah no not Magic i mixed up the complexity levels here at least i hoped FFMPegSource wouldn't crash Avisynth in this particular case, like the Directshow Filter isn't crashing the Player.

ajp_anton
28th July 2008, 06:05
Would it be possible to add some kind of frame information into a corner, like frame type, size, number... ?

Myrsloik
28th July 2008, 14:31
What can be easily done is to set a variable in every getframe call so you can write it on the clip/use it in scripting. I haven't looked that closely yet but I think that should would very well for the frame type.

Frame size? dimensions? bytes? explain what and why you want it.

The frame number is already possible to add using one scriptclip line so that will never be added.

Dragon4333
28th July 2008, 17:14
i was using FFmpegSource on making a lossless with filters and the video went form 25:40 to 6 min. anyone got any ideas why this is happening

TheFluff
28th July 2008, 18:22
i was using FFmpegSource on making a lossless with filters and the video went form 25:40 to 6 min. anyone got any ideas why this is happening

Is the framecount the same? Is the file VFR? What container is it?

Dragon4333
28th July 2008, 19:51
yea the framecount is the same its 37280 for both. and yea its a vfr o yea and if it help the framerate is 95.923261 for the both of them and the raw is mp4 and then i made a lossless with filter so its in a avi now. and i have the timecode thing from FFmpegsource

CruNcher
28th July 2008, 20:50
@Myrsloik

The unsync problem seems to be found it's only happening with ffdshow, tough the crash with ffmpegsource is still a mistery to me :(
here is the file http://mirror05.x264.nl/CruNcher/force.php?file=.//vegas.mkv

funny thing is i now get another error message in the cmd [vc1 @ 0194CE30]Illegal DC VLC and a imediate player crash (closing down of mpc)
and i slowly get the impression it has something todo with the soundtrack as without it, it doesn't seem to crash ffmpegsource.

Myrsloik
28th July 2008, 23:01
Released 1.20 which is just a recompile with a newer FFmpeg but maybe some more stuff works now. Haven't had time to look at any of the problem files yet.

Asking for help in private messages WILL NOT WORK IF YOU END EVERY SENTENCE WITH LOL. (this is not necessarily because I won't answer the question but if you don't know what the dot thingy is you're very unlikely to understand the answer)

Dragon4333
28th July 2008, 23:32
ok i tried adding in the timecodes thinking that it would fix the prob but it did not so now i have a video that plays for 6min or so then audio that last for 25:40. so that did not work any other ideas

martino
28th July 2008, 23:58
What does "adding in the timecodes" mean? You want to say you muxed the encoded video that you got from ffmpegsource with timecodes and the audio, and the length came out different?

CruNcher
29th July 2008, 00:10
@Myrsloik
Thx for the new Compile, tough it still doesn't work (i guess it was no wise decission to abondon every container yet, before testing interoperability completely) i also tried atrack=-2 no response the new version doesnt show any messages anymore but just stops doing anything except getting the fps to X264 :(

TheFluff
29th July 2008, 16:37
Opening an AVI file now gives you an assertion failure in avidec.c.
file: libavformat/avidec.c; line: 1029; expression: st2->time_base.den == ast2->rate

The same thing happens with Aegisub when using the ffmpeg provider so I suspect some enterprising libavformat patcher broke something a few weeks ago.

sh0dan
31st July 2008, 19:40
@Zhelkus: You cannot get support for your illegally obtained material here. Read the rules.

Zhelkus
1st August 2008, 02:05
@Zhelkus: You cannot get support for your illegally obtained material here. Read the rules.
Aw, you deleted my entire post. :scared:

What's illegal about working with ripped DVD content? I'm familiar with the rules, especially the one you're accusing me of, since I had to make sure that I was complying with it. My brother got me the first 3 volumes from amazon, he ripped it to mkv and now I want to re-encode it to watch it in our iPods for when he comes back. Then I saw this plugin that wouldn't have the audio delay directshowsource() seems to have when reading from the matroska container. That's all.

Could you restore my post please? I would really want this to work out nicely without any trouble.

mikeytown2
1st August 2008, 03:18
@Zhelkus Simple solution is to re-rip (http://www.doom9.org/guides.htm) your dvd's and encode it for ipod playback. Probably get a better encoded file since there will be less lossy steps. This forum (http://forum.doom9.org/forumdisplay.php?f=9) should be able to help you with the DVD if you encounter any issues with it.

Adub
1st August 2008, 18:57
No, your brother did not rip them for you. If you looked at the file name, "[a4e]..." then you would know that it was from an anime ripping group. Probably Anime 4 Ever. So, unless your brother is from that group, your lying.

It seems the suspicious flag was [DVDrip]. This is standard practice in pirate circles which is what flagged you in the first place. That was my mistake. I apologize. But the use of bracketed file names is rarely if ever used in home backups.

martino
1st August 2008, 19:10
Maybe he did? Who knows lol...

Zhelkus
1st August 2008, 19:40
Well now I'm made to look like a bad guy. That's swell. I'm saying he gave me the MKVs and I was simply going to get them to work on our iPods. Simple re-encode. I don't understand why he would download them if he showed me the boxes he got. I just wanted to work with the mkvs because they were already on the computer and the quality on them is really good.

@merlin: I didn't see any bracketed group name on the filenames, just "[DVDrip]". But if I can't convince you that I'm not lying, then there's not much reason to ask for assistance since I'm not welcome to.

I'll just work with the vobs. Sorry for the misunderstandings.

Adub
1st August 2008, 20:56
The [a4e] was more of an example. I thought I saw it in your old post, but it must have been the [DVDrip], which is standard practice in the pirate circles. However, the naming scheme is usually much more elaborate, so I am willing to believe that maybe your brother did rip them, and just decided to add that suspicious flag.

Honestly, I would recommend working directly with the Vobs, as they will produce higher quality output, vs an encode --> encode.

Guest
1st August 2008, 21:26
@Zhelkus

You would not have said you "obtained" (your quotes) an MKV if your brother had given it to you. Next time, don't get cute, say where you got it. Also, the "[DVDRip]" in the file name is highly suspicious and tends to corroborate the first point. Finally, first you say your brother "got you" the DVDs, then you say later "he showed me the boxes he got". Why would he need to show you the boxes if he got the DVD set for you?

So just drop it. A moderator examined your post and ruled on it. Do not discuss it further in this thread. Use a PM to sh0dan if you feel wronged. If you don't get satisfaction, then appeal to Doom9.

ajp_anton
2nd August 2008, 04:21
What can be easily done is to set a variable in every getframe call so you can write it on the clip/use it in scripting. I haven't looked that closely yet but I think that should would very well for the frame type.

Frame size? dimensions? bytes? explain what and why you want it.

The frame number is already possible to add using one scriptclip line so that will never be added.Can't remember what I meant with frame number so forget that one =)
With frame size I mean in bytes.

I use ffmpegsource to compare an encode with the source since directshowsource sometimes fails to be frame-perfect. What's missing is something telling me what frame type and size I'm comparing, something like the OSD options in ffdshow.

TheFluff
4th August 2008, 09:32
Public service announcement: the Aegisub SVN server has moved to http://svn.aegisub.net/. Hence, the ffmpegsource source code has been relocated to there as well and can now be found at http://svn.aegisub.net/trunk/FFmpegSource/. It is also available through HTTPS but the SSL certificate is bogus so you'll have to press a button or two if you do it that way.

Myrsloik
10th August 2008, 23:00
I've now gotten around to cleaning up FFmpegSource quite a bit. The reason for this is to finally turn it into a useful library that can relatively easily be used from other programs. What will be possible is to call indexing separately from a another program and have it report on the progress. The indexing process itself is also greatly improved since all tracks are indexed at once so only one index file will be needed.

What I'm not sure what to do about is the audio support. As it is now FFAudioSource() (no decoded cache) appears to be too buggy for anyone to actually use. So I intend to remove it at least temporarily unless someone complains.

FFmpegSource() will probably be split into FFVideoSource() and FFIndex(). Or at least that's what I think it will be called. FFIndex() will (hopefully) be able to do indexing and write the selected audio tracks as wave files in one pass.

Maybe I'll even add some of that elusive framerate conversion I hate so much...

Are there any comments on this structure and the changes? Other resonable feature requests?

A final version or two based on the old code with a newer FFmpeg library will also be released until the new stuff works.

And if anyone missed it the unrelated discussion moved to here (http://forum.doom9.org/showthread.php?t=140117).

vlada
12th August 2008, 06:38
Myrsloik
I think this is a very good idea. Splitting the indexing into a standalone CLI application would be a big improvement for me.

I personally use FFAudioSource without much problems. But for me the only advantage using it is the possibility to avoid decoding of audio track(s). But with splitting indexing and audio decoding to separate CLI application, I probably wouldn't miss it.

IanB
12th August 2008, 10:05
@Myrsloik,

Being able to pre-index the sources with a free standing application will be a great boon for the advanced user. Many speed optimisations are possible if only parsing the structure and not actually decoding it. Done well you should be able to read through most files at close to maximum disk speeds i.e. 80 to 100+ MB/s.

Still having indexing be done at startup, like now, would make it simple to use for the novice user. And maintain version usage compatibility.

Indexing the audio so it can be directly accessed and decoded on the fly is superior to decoding it to a wave file. The size of the uncompressed audio can easily exceed the size of the input A/V file, doing this much writing can significantly slow the indexing process down. Compare DGDecode speed when just writing a .D2V file and when also demuxing/decoding the audio.

The current problems with audio seeking can probably be cured by doing 1 frame of pre-roll. i.e. Seeking to sample 10000. Look in index, find block 150 has samples 9975 to 10240. So access block 149 (samples 9709 to 9974) and then pre-roll 291 samples. If a format has dependencies that span more than 1 block just increase the pre-roll to suit.

Myrsloik
19th August 2008, 19:18
New version. Just another FFmpeg refresh which hopefully works properly for avi files and everything else this time.

@Ian

The idea is to automatically index a video file when opened and an index doesn't exist OR allow it to be created in advance. That should be the best compromise for most users. I will however not bother with previous version compatibility because it's just too different. Maybe a wrapper function or something as a separate script but things will be moved around too much.

And are there any plans to extend WAVSource() in avisynth to handle wave64 files? As it is now I'll probably have to include a simple reader for them as well (using libsndfile?) to make audio handling easier.

IanB
19th August 2008, 23:54
... automatically index a video file when opened and an index doesn't exist OR allow it to be created in advance.Yes that will be a friendly implementation. :D

I will however not bother with previous version compatibility because it's just too different. Maybe a wrapper function or ...:( Don Graft seems to share your unfortunate attitude. I recently enhanced the parser to handle overloaded function definitions based on the named argument, previously it only used the argument type pattern (ignored the arg names). This should make it easier to keep script compatibility between versions. At the least try to keep the order of the first few arguments the same so minimal scripts keep working without change. If you need a massive arg list change then you probably should change the name of the function.

And are there any plans to extend WAVSource() in avisynth to handle wave64 files?Somewhere down the track I want to update the import of all the VDub code for AVISource/OpenDMLSource/AVIFileSource/WAVSource. The current is from circa 1.4.8 and there have been many bugs fixed and features added since then that we are missing out on, hugh AVI/Wave64 being just one.

tebasuna51
19th August 2008, 23:55
...

And are there any plans to extend WAVSource() in avisynth to handle wave64 files? As it is now I'll probably have to include a simple reader for them as well (using libsndfile?) to make audio handling easier.

Can help RaWavSource() from NicAudio.dll v2?

Open w64, rf64, WAVE_FORMAT_EXTENSIBLE, and wav files >4GB (with 'data' last subchunk)

acrespo
21st August 2008, 05:19
When I open a MPG file with AC3 audio, I can't open the audio part because avisynth crash. I need to put atrack=-2. Can anybody help me?

EDIT:
I can't open audio with ffmpegsource("file.mpg", atrack=-1) but I can open with ffaudiosource("file.mpg"). This resolve my problem.

Myrsloik
21st August 2008, 05:35
With all of that information, no. Things you could try and report the results of:
Try to play the file using a recent ffplay.exe
Demux the ac3 audio and see if it works separately
Post a small part of the file so others can try

acrespo
21st August 2008, 16:12
here is the link to a piece of file:
http://rapidshare.com/files/138995487/dbz193__02_.mpg

And here is the script:

SetMTMode(2,2)
LoadPlugin("c:\encodes\filtros\fft3dgpu.dll")
LoadPlugin("c:\encodes\filtros\ffmpegsource.dll")
LoadPlugin("c:\encodes\filtros\dgdecode.dll")
LoadPlugin("c:\encodes\filtros\ffmpegsource.dll")
LoadPlugin("c:\encodes\filtros\tivtc.dll")
LoadPlugin("c:\encodes\filtros\mt_masktools.dll")
LoadPlugin("c:\encodes\filtros\awarpsharp.dll")
LoadPlugin("c:\encodes\filtros\Toon-v1.0.dll")
LoadPlugin("c:\encodes\filtros\nicaudio.dll")


FFmpegSource("g:\dbz193.mpg",atrack=-1)
amplify(1.5)

AssumeTFF()
TFM(order=1,mode=6,PP=7)
TDecimate(mode=1)

Crop(8,8,-16,-8,align=true)

SetMTMode(5,2)
FFT3DGPU(sigma=6.0, bt=2)
SetMTMode(2,2)

Spline36Resize(720,480)

Toon(Strength=0.5)



And the error is: Evaluate: System Exception - Access Violation (on line 13)

check
22nd August 2008, 04:53
Is it possible your system is running out of RAM or VRAM?

Revgen
22nd August 2008, 09:46
@acrespo

Have you tried using DGMPGDec instead of FFMPEGSource?

Myrsloik
27th August 2008, 21:53
@acrespo

Your file will work in the next version (2.0 most likely). I'm however far too busy with other things right now to fix the last memory leaks so I can't say exactly when it will be released. Send me a pm if you want to try the unfinished version.

I've also realized that I have no idea how to make nice import libraries and header files in c++ so that will take even longer...

smok3
9th September 2008, 09:18
i somebody has done a nice/correct avisynth script for xdcam ex, i would appreaciate if you could post it here?

(btw, The footage will be 1920x1080 50i and i need 1280x720 50p)

so far:

LoadCPlugin("t:\utility\avisynth\yadif\yadif.dll")
LoadPlugin("t:\utility\avisynth\ffmpegsource\FFMpegSource.dll")

ffmpegsource("g:\tmp\406_0693_01.MP4")
yadif(mode=0, order=1)
resize(1280,720)
# Levels(16, 1, 235, 0, 255, coring=false)

i don't think the colors are ok, some colormatrix fix i need?

Adub
11th September 2008, 08:51
You don't think the colors are ok, or you know the colors are wrong? Do they look different if the file is played alone in a media player? Meaning, just drag and drop into MPC.

Myrsloik
12th September 2008, 15:52
It is finally done. Or close enough to done. Actually I'm waiting for TheFluff to learn how to program so I don't have to write more stuff myself...

The most important changes:

2.00 beta 1
Can now be used as a stand alone library for making indices and retrieving frames
Rewrote most things
Updated FFmpeg to rev 15301


FFmpegSource 2.00 beta 1 (http://ivtc.org/new/beta/FFmpegSource-2.00b1.rar)

Source: http://svn.aegisub.net/trunk/FFmpegSource2/

Next I'll probably try to add audio decoding again in a similar way to how FFAudioSource worked. If someone wants to write a simple CLI (or otherwise) program to create indices from outside avisynth look at ffms.h and ffavsfilters.cpp (or wait for TheFluff).

flywitness
22nd September 2008, 21:04
Can you tell me how to access the audio using this.

I can do this to get my section of video:

mycut=trim(clip, 50, 100)

but how do i get the corresponding audio section?

Myrsloik
22nd September 2008, 22:21
No, I can't. You didn't mention which version of ffmpegsource you used or provide the script line you use to initialize your clip variable.

SpAwN_gUy
23rd September 2008, 10:09
Can you tell me how to access the audio using this.

I can do this to get my section of video:

mycut=trim(clip, 50, 100)

but how do i get the corresponding audio section?

u have to replace "clip" with corresponding input-audio-load function.
i.e. (this is just a sample.. functions may be wrong)
for video:
clip=FFmpegsource("some.avi")
for audio:
clip=FFaudiosource("some.avi")
and then
mycut=trim(clip, 50, 100)

read the AviSynth guide. it is provided with installation.

flywitness
23rd September 2008, 10:57
Sorry. I should have made it more clear. With V1.21 I can do this:

v1.21
-----
c=FFmpegSource(source, vtrack=-1, atrack=-1)
c.trim(50, 100)
SoundOut(c, output, blah...)
c

I can then open and add my soundout track as the audio in avidemux. Great.


However, In V2, I cannot find any way to access the audio that corresponds to my video trim. FFAudioSource has vanished along with FFmpegSource. Instead we have FFVideoSource which only deals with video it seems, and FFIndex which as far as I can see, only writes the entire original source clips audio to disk.

Unless I'm overlooking something, it would appear that V2, in it's current form, is missing some important functionality (important to me anyway :) ).

Have I missed something?

Myrsloik
23rd September 2008, 15:55
You missed the sentence right below the link you downloaded v2 from. It says: "Next I'll probably try to add audio decoding again in a similar way to how FFAudioSource worked."

The only way to currently get audio from the v2 beta is to open the .w64 files with RaWavSource and use audiodub or whatever the filter was called. There's also a good chance I'll one day write my own wave64 source filter and include it to make the process easier. If I ever get that far it should be easy to write a function that wraps everything to work in a similar way to v1.

flywitness
23rd September 2008, 19:03
ok. thanks.

i'll stick with 1.21 for now then.

tebasuna51
23rd September 2008, 20:21
The only way to currently get audio from the v2 beta is to open the .w64 files with RaWavSource and use audiodub or whatever the filter was called.

Now RawavSource don't support .w64 files than FFIndex wrote.

The problem is the 'fmt ' chunk length. The field is filled with 0x2C when the offset to 'data' chunk is 0x30 like other software like SoundOut and sndfile-convert (libsndfile-1.dll) put.

BTW, after this correction, I remember the needed channel remap (for ac3 input):
GetChannel(1,3,2,6,4,5)

Myrsloik
23rd September 2008, 21:51
The offset will be fixed in the next beta.

tebasuna51
24th September 2008, 00:40
The offset will be fixed in the next beta.
Thanks, I think is better use exact chunk sizes.

BTW your value is also valid because in w64 specs say:
6. All chunks are byte-aligned on 8-byte boundaries,
but their chunk size fields do not include any padding if it is necessary.
Standard RIFF/WAV files use 2-byte alignment of chunks.

The next NicAudio plugin version will support also this issue.

IanB
24th September 2008, 09:55
When writing these files it is best to obey all the restrictions in concert, i.e. make sure all chunks are actual multiples of 8 bytes! even if you have to invent up to 7 bytes of nulls at the end. Thus the padding issue never comes up.

When reading if possible cope with all the likely stuff ups people make when writing these files, i.e. expect bad 2 bytes alignment, roll in clover and throw a party if it is correctly 8 byte aligned. Of course sometimes you cannot, so you must follow the letter of the spec or provide a user option to override a common bad case.

Myrsloik
24th September 2008, 17:44
Released a much improved beta. See the front page for the changes.

buzzqw
25th September 2008, 13:34
in latest beta package is missing "ffmpegsource2.dll"

BHH

Myrsloik
25th September 2008, 17:36
Rename the included dll then. They are supposed to be the same.

Myrsloik
26th September 2008, 01:59
Because of a certain other thread with certain other people I have now ordered a gf8400gs (at 2 AM in the night because I'm so generally displeased with the state of the world). I don't know if I'll have time to actually do something with it but I WILL TRY. (financing already secured so no donations (http://pastebin.ca/1211083) will ever be necessary) That is almost all.

The official short way to refer to this project is also from now on FFMS2. It stands for Fabulous FM Source 2 (never was a 1 but who cares?).

Keiyakusha
26th September 2008, 02:51
I get an error "Access Violation" when trying open uncompressed RGB in avi. This is probably a bug...

Myrsloik
26th September 2008, 02:53
There are two things I like. Sample files and complete bug reports. This means you include the version since there are two likely versions you could be using right now.

Keiyakusha
28th September 2008, 17:26
Myrsloik
Sorry. Sample files (http://jtsknw.blu.livefilestore.com/y1pfofnNLWqQRQ2zHCfjUUhNWFWVzobNc4Cu3CfGh6JAmgf_ySvt4U0M0kUKWg9Q6z69_ziWJ0IR9G8mRNb_74o-g/FFtest.7z) has been generated in VirtualDub.
The version is 2.00 beta 2, but I think 1.21 also don't work.

Non uncompressed formats works fine.

chriszxl
28th September 2008, 17:50
the v2.0 beta2 ,the source file path can not contain special characters, like Chinese,but 1.21 no problem with that.

Myrsloik
28th September 2008, 19:01
These are two very odd bugs. The uncompressed files almost seem like they corrupt the stack somewhere and that is no fun to debug. I'll add it to my todo list but this will take time to investigate...

The special character issue I have no idea what to do about. Nothing was changed in the handling of input or compilation of ffmpeg. I suspect it's somehow caused by changes in ffmpeg since other odd things have happened with support for large files appearing and disappearing in my builds. Try your luck with the next beta and report your findings.

Myrsloik
2nd October 2008, 19:36
Behold the glorious third beta. It brings a VFR to CFR mode for all you matroska haters (ironically it was debugged by TheFluff). An indexing program linked against the right dll name and a much improved FFAudioSource which can fail in completely new ways WITHOUT an extra cache file.

The summary: FFMS2 can now do everything 1.x could

But it's still beta because I have two (http://forum.doom9.org/showthread.php?t=80762) more (http://forum.doom9.org/showthread.php?t=141104) things I want to try to add...

nurbs
3rd October 2008, 11:22
Hello. I have a problem with ffmpegsource (2.0b3) and vc-1 encoded files in mkv container. The indexing works, but when I try to open the files in an avisynth script I get:
Evaluate: System Exception - Access Violation

Happens with every vc-1 file I got from HD-DVD and Blu-Ray disks. The files play fine using MPC-HCs internal (non-DXVA) vc-1 decoder.
I uploded a sample of the clip: http://www.megaupload.com/?d=FD07G9U3

Atak_Snajpera
3rd October 2008, 12:38
Hello. I have a problem with ffmpegsource (2.0b3) and vc-1 encoded files in mkv container. The indexing works, but when I try to open the files in an avisynth script I get:
I had similar problem with older version so I was forced to switch to DirectShowSource(ffdshow)

Myrsloik
3rd October 2008, 14:55
I found a bug so now it says it can't open the codec (unsupported) instead of causing an access violation. It doesn't work in a recent mplayer either so I don't think ffmpeg can decode that file yet. Remuxing it to avi also produces exactly the same results.

Atak_Snajpera
3rd October 2008, 15:06
It doesn't work in a recent mplayer either so I don't think ffmpeg can decode that file yet.
FFDshow is based on ffmpeg project so why libavcodec has no problems with that mkv?

ffmpeg.exe is able to detect that mkv
http://img186.imageshack.us/img186/1716/new1ok1.th.png (http://img186.imageshack.us/my.php?image=new1ok1.png)http://img186.imageshack.us/images/thpix.gif (http://g.imageshack.us/thpix.php)

nurbs
3rd October 2008, 15:32
MPC-HCs internal decoder is also based of ffmpeg and plays the file, which is why I mentioned it in my post.

vlada
5th October 2008, 14:42
Hi,

I have a problem with the ffmsindex.exe program. I want to use it because unlike FFVideoSource it can show it's process. Unfortunately once I use it from my program it doesn't show the progress anymore. Unfortunately my programming knowledge is quite poor, so I'm just guessing what the problem could be.

I'm periodically reading from stdout of the ffmsindex.exe process. Unfortunately I don't get anything before the process finishes. Then it writes "Indexing, please wait... 100%". So I can't display any progress. I'm using the same approach for many other CLI programs like xvid_encraw, ffmpeg, lame etc. Do you have any idea what could be the problem?

I have two more questions/feature requests:

1) There is no documentation on the new FFAudioSource. Could you please tell me what are the usable parameters?

2) Is it possible to add an option to index only a part of a video file? So in the output would be only the selected part of the video...

3) I would like to have an option to suppress all warnings and errors (like the one regarding VfW AVI B-frames).

Myrsloik
5th October 2008, 16:44
The indexing program wasn't written by me and I actually haven't looked closely at the source yet (but I suspect that I soon will have to). Most likely TheFluff did something very clever. So clever no other CLI app does it. In the future it should also be easier for you to link directly to ffms2.dll when doing indexing. (unless you use a very weird programming language)

1) They are identical to the four first of FFVideoSource. (source, track, cache, cachefile)
2) No, there's no reliable way that I know of to skip frames in the way that's required. All I can think of would more or less be equivalent to putting trim() after the source filter.
3) I think all of those are directed to stderr but I'm not sure. Logging things seems to be very integrated into ffmpeg itself so I'm not sure what can be done about it but I'll look into it.

Atak_Snajpera
5th October 2008, 20:50
I have a problem with the ffmsindex.exe program. I want to use it because unlike FFVideoSource it can show it's process. Unfortunately once I use it from my program it doesn't show the progress anymore.
I have the same problem. It would be nice if you added switch so every percent would be in new line. This should solve our problem.

vlada
5th October 2008, 20:51
Atak_Snajpera> I'm glad you confirmed the problem. I was afraid there might be something wrong on my side.

Myrsloik> Thanks a lot for your answers. I know that the indexing program wasn't written by you, but I hope TheFluff is hanging somewhere around. I'm using Python as my programming language. There is a ctypes wrapper to load compiled C libraries. But I have no knowledge how to use it. Also I would have to introduce threading, because using external DLL locks the main loop. So an external CLI application (which runs in a separate process by default) is right now the best solution for me.

I'm working on a program which would take any input video, process it with AviSynth and output it to many predefined formats (based on presets). It should be able to process many files at once. The workflow is following:
1) You select your files to convert
2) The files are added to list and analyzed (audio/video parameters, autocrop etc.) and previews are created
3) You select a preset (PMP model, cellphone model, typical HD rip or custom preset)
4) Just press "Encode" and wait until it is finished.

There is an additional 2b step step, where you can change many parameters, but some are locked or limited to keep compatibility with the preset you selected. So using it should be really simple. But I'm currently not satisfied with the step 2. Opening video files takes a long time (mainly because of indexing) and I can't even show it's progress. Choose one file, wait a minute, then choose another one, another minute and so on. That disappoints you...

So this why I was asking if it would be possible to index only a part of a video file. To display a preview or to detect letterboxing I only need few frames from the video. As you said - like using Trim() - but much faster. The full indexing would be done before compression.

As for the errors, I get them from stdout. But maybe I've redirected the stderr to stdout. As I said I'm still quite lost in this, I only understand the high level programming. I will need to have a deeper look into this and how do the modules I use work. In case somebody's interested I use this (http://code.activestate.com/recipes/440554/) module to run external processes.

Quark.Fusion
11th October 2008, 16:00
Looks like there is memory leak during indexing of a file — during indexing of 50gb m2ts file memory usage pimp up to 1.6gb and ffmsindex crashed (same with virtualdub).

Is it ever possible to access file in linear manner without indexing?

Myrsloik
11th October 2008, 17:17
There shouldn't be any leaks in that part of the code, at least not that depend on the number of frames or file size. Did it get far before crashing? How far does it get in the the file if you use ffmsindex.exe?

I guess I could add yet another seekmode that does linear access without indexing. The problem is that you would have to specify exactly how many frames the source has since avisynth (and vfw in general) doesn't allow it to change after a file has been opened. Could it still be useful with that limitation?

Quark.Fusion
11th October 2008, 17:56
I don't sure at which frame it crashes, but there is definitely a memory leak as memory usage go up and up, with my file it crashes near 900MB of file position. Also during indexing it uses 100% of single core while reading file very slowly — is it decoding to build index?
Maybe it tries to allocate some buffer with size as fraction of system memory? My system is Vista x64 with 8GB RAM.

I can't understand why you can't detect number of frames as directshow returns it without indexing (or that estimated value?).

buzzqw
12th October 2008, 09:54
The problem is that you would have to specify exactly how many frames the source has since avisynth (and vfw in general) doesn't allow it to change after a file has been opened. Could it still be useful with that limitation?

not mutch, because we must rely on another tool for analyze the movie

BUT if easy to implement.. feel free to do it :) thanks

BHH

Quark.Fusion
12th October 2008, 12:27
not mutch, because we must rely on another tool for analyze the movie
It's still faster that waiting for index, especially when it can't construct it :)

liquidator87
12th October 2008, 14:08
I can confirm the huge memory usage during indexing... till the program crashes :(
Tried to index a 20 GiB m2ts file, the memory usage increases till it reaches the max... then BUM!

vlada
12th October 2008, 18:30
I guess I could add yet another seekmode that does linear access without indexing. The problem is that you would have to specify exactly how many frames the source has since avisynth (and vfw in general) doesn't allow it to change after a file has been opened. Could it still be useful with that limitation?

This would be very useful for me, because I detect the number of frames with MediaInfo anyway. So I know the number of frames before creating the AviSynth script.

saint-francis
21st October 2008, 14:43
Myrsloik, are you interested in samples that make you tool crash?

Myrsloik
21st October 2008, 15:32
Yes, if they don't also make fairly recent mplayer/ffmpeg compiles crash. Or have been mentioned in the two previous pages because I can still remember those.

Akatsuker
28th October 2008, 12:10
Hi, i've just tried the FFVideoSource in a VFR mkv file. All the time, all that I've got is:

"Could not open video codec"

FFVideoSource("E:\video02.mkv",timecodes="TESTTIMECODES.tc",seekmode=1)

I don't know, maybe I doing this wrong. Can you help me?
Thanks a lot in advance.

loliconxd
28th October 2008, 12:47
mmmm, ffmpegsource can't open correctly vfr files, try with dss or dss2.

tacman1123
20th November 2008, 19:02
I have the FFMS2.dll in my plugins directory, but I still get an error using FFMegSource() -- did the call change as well? I had another problem, I think, with FFMegSource.dll in the directory as well, is that Version 1?

EDIT: I figured it out, at least I think I did, the call is now FFMS2_FFVideoSource(), yes?

LoRd_MuldeR
20th November 2008, 19:03
There is no FFMpegSource() in FFMS2.dll (version 2), you must use FFVideoSource() and FFAudioSource() now. Also FFMegSource.dll (version 1) won't be needed!

Didn't you read the readme file? ;)

Myrsloik
20th November 2008, 20:56
A possibly fixed version of the cli index app is now available from http://ivtc.org/new/beta/ffmsindex-progressfix.7z

Try it and report the results. Don't expect any major updates until 2011.

Fizick
20th November 2008, 21:39
Thanks, 2011 is not so distant year :)

tacman1123
20th November 2008, 23:39
I don't have FFDSHow or Haali Splitter installed, they seemed to really interfere with basic playing of AVI files and returning bad frame info when those avi files were called through Avisynth.

So I was hoping that my mp4 file, which definitely has audio in it and plays fine in GOM, would be able to get the audio with FFVideoSource and/or FFAudioSource. FFVideoSource returns HasAudio as false, and when I try to load the mp4 file with FFAudioSource(mp4_filename), it gives me


Evaluate: System Exception - Access Violation


Any chance I'll be able to hear audio of mp4 files through avisynth with FFAudioSource? Or something else?

Thx,

Tac

LoRd_MuldeR
20th November 2008, 23:45
You need to do it like that:
v = FFVideoSource("C:\Foobar.mp4")
a = FFAudioSource("C:\Foobar.mp4")
AudioDub(v,a)

But if FFAudioSource() fails on your source file, you'll need to obtain the audio in a different way...

vlada
2nd December 2008, 10:06
A possibly fixed version of the cli index app is now available from http://ivtc.org/new/beta/ffmsindex-progressfix.7z

Try it and report the results.

Thanks for the updated version. Unfortunately it still doesn't work for me unless I'm doing something wrong. The CLI output is still a single line. I get no output during indexing, after it finishes, I get 33% and 67% progress messages. Any idea what might be wrong?

CruNcher
2nd December 2008, 15:43
@Myrsloik
Any progress on the GPU Decoding support ?

Myrsloik
2nd December 2008, 17:55
When I say 2011 I MEAN 2011. If anyone in Sweden wants to buy a new very lightly used GF8400 GS send me a message. The only thing I've worked on is the other link and there's a serious bug somewhere in that project. But look forward to 2011, it will be a year to remember.

vlada
29th December 2008, 01:33
During the Christmas I spent quite a lot of time on finishing my transcoding application. I discovered some bugs and problems in FFmpegSource which I would like to report.

1) The first and most serious bug is related to index reading and creating. I found out that files with accented character in path can't be opened. There is a problem with codepage conversion somewhere. Let's say my file is C:\ěščřž\video.avi. Simply using FFVideoSource would fail. But if I specify the location of index to C:\temp\index.tmp, then it opens. The standalone FFMSIndex has the same problem. I use cp1250 for AviSynth script encoding.

2) Another problem is that some errors and warnings are probably output to STDOUT and then it is sent to encoders STDIN and the output is corrupted. It might be a mistake on my side too, because it only happens if I run it from my program. If I run the same command separately the created video is correct, but the encoder's output is mixed with error/warning messages from FFmpegSource. Would it be possible to disable all such messages, maybe by an option/switch?

3) Then I found some FLV (VP6F/MP3) files, which produce a silent audio track. The files work correctly in ffmpeg.

If you are interested into samples showing the #3 issue, let me know. If you need any further details to the first 2 problems, I can provide that too.

Thanks a lot for looking into these problems. I can't release my program without having a fix or workaround for the first 2 points.

Myrsloik
29th December 2008, 17:00
1. Does it work with avisource or directshowsource or any other source?
2. Call FFNoLog() first in the script in the next version
3. It's always good to have more test clips

Could you also make a small program that shows your problem with the indexing app? that way it's much easier to get TheFluff to fix it.

If you want to test what will be the next version find me in #darkhold on rizon and I'll send it to you (or anyone else who wants to test stuff).

Myrsloik
31st December 2008, 01:22
New beta released, mostly because FFmpeg was getting a bit old. The big news is greatly improved and slightly broken TS parsing. It now uses Haali's splitter (needs to be installed or TS files won't work) to provide almost frame accurate seeking. Almost meaning that if you access the first 200 frames or so it won't work right but if you only access later frames it has in my testing always worked perfectly. (yes, very weird)

So if you use it you might want to do something like
FFVideoSource(...).Trim(200,0)
for now.

SAPikachu
31st December 2008, 06:40
Hi,
First of all, thanks for your great filter, it helped me a lot.

I'm using FFMpegSource in my program, it can get key frame list from index file and seek by key frames. With beta 3, seeking to a key frame is very fast. But it is significantly slower in beta 4. For mp4 container, it is ~5x slower with beta4 than with beta3. MKV is faster than mp4, but still slower than with beta3.
Could you look into this problem? If you need some video samples, please let me know. Thanks in advance.

Myrsloik
31st December 2008, 14:48
I forgot some debug code when seeking that made it decode many more frames. Redownload beta 4 and it will be fixed.

SAPikachu
1st January 2009, 03:56
The problem is solved, thanks a lot!

vlada
2nd January 2009, 21:47
1. Does it work with avisource or directshowsource or any other source?
2. Call FFNoLog() first in the script in the next version
3. It's always good to have more test clips

Could you also make a small program that shows your problem with the indexing app? that way it's much easier to get TheFluff to fix it.


1) The problem is only in index location, not in the file location. So there are no problems with the file using AviSource or DirectShow source.

2) Thanks for the improvement!

3) For the not working Flash Video see this file (http://rapidshare.com/files/179397958/IK_-_WWW.flv.html) (4,5 MB).


As for my problems with getting progress from ffmsindex.exe, here is a sample code: http://rapidshare.com/files/179395825/test.zip.html (4 kB).

To run it you would need PyGTK (= Python, PyGTK, PyGobject, PyCairo), GTK+ and Python Win32 Extensions. All installers can be easily found and downloaded. If you (or TheFluff) prefer, I could provide a compiled version including all libraries, but this way you can look into the source code and modify it.

loliconxd
9th January 2009, 15:09
one question.

the ffmpeg.. 2.0 support vfr?

TheFluff
9th January 2009, 21:42
one question.

the ffmpeg.. 2.0 support vfr?
What do you mean by "support"? It can read timecodes from the loaded file and write them to a timecodes file, but since Avisynth doesn't support VFR, it will set the framerate to some arbitrarily chosen bogus value (for mkv's it's based on the average frame duration, for everything else it's based on the duration of the first frame) and let you decide what you want to do with it. If you mean convert VFR to CFR, that is supported too, just read the manual.

vlada: I will look at your problem sometime after next weekend.

guest0815
16th January 2009, 14:10
Where did the timecodes' decimal places go with ffmpeg2?


#timecode format v2
0.000000
41.708333
83.416667
...

#timecode format v1
Assume 23.976000


#timecode format v2
0
41
83
...

#timecode format v1
Assume 23.976000
0,0,24.390244
1,2,23.809524
3,3,24.390244
4,5,23.809524
...

thank you

Myrsloik
19th January 2009, 00:38
They will return in the next version. (if I remember to fix it)

TheFluff
24th January 2009, 17:39
@vlada: I've been looking at your problem with ffmsindex.exe and can't reproduce it with any code I've written myself. For example, this perl script:
#!/usr/bin/perl
my $res = `ffmsindex -f "blah.mkv"`;
$res =~ s/\r/\r\n/g;
print $res;
prints this, as expected:
Indexing, please wait... 0%
Indexing, please wait... 1%
Indexing, please wait... 2%
Indexing, please wait... 3%
Indexing, please wait... 4%
Indexing, please wait... 5%
Indexing, please wait... 6%
Indexing, please wait... 7%
(etcetera)
Indexing, please wait... 100%

Writing index... done.

I can't see how this is a problem on my side. I'm doing things pretty much exactly like every other CLI app, including x264, except I'm using the C++ iostream instead of x264's plain c stdio. I don't know what you're doing wrong but it's probably something trivial (such as forgetting to convert \r to \r\n or something).

MadRat
25th January 2009, 21:57
Thanks for the update, I'm eager to use the release version.

lubczyk
30th January 2009, 06:58
So what do I use to convert from vfr to cfr in the syntax? Do I set one and or both fpsnum and/or fpsden and what values are expected? I know the framerate of my video BTW.

TheFluff
1st February 2009, 10:32
FFVideoSource(string source, int track, bool cache = true, string cachefile = source + ".ffindex", int fpsnum = -1, int fpsden = 1, string pp, int threads = -1, string timecodes, int seekmode = 1)
(...)
fpsnum & fpsden:
For VFR -> CFR conversion. Setting fpsnum <= 0 means a 1:1 relation with the encoded frames.
Other hints:

num stands for "numerator" and den stands for "denominator"; as in a fractional number.
Both parameters are integers.
fpsnum defaults to -1; fpsden defaults to 1.
Standard NTSC framerate is not 29.97fps, it's 30000/1001fps exactly.
If you are completely lost, check out the Avisynth documentation for AssumeFPS/ChangeFPS/ConvertFPS.


I'm sure you can figure it out from there.

lubczyk
3rd February 2009, 22:26
Other hints:

num stands for "numerator" and den stands for "denominator"; as in a fractional number.
Both parameters are integers.
fpsnum defaults to -1; fpsden defaults to 1.
Standard NTSC framerate is not 29.97fps, it's 30000/1001fps exactly.
If you are completely lost, check out the Avisynth documentation for AssumeFPS/ChangeFPS/ConvertFPS.


I'm sure you can figure it out from there.


Thank you!!! That helped alot.

lubczyk
4th February 2009, 16:01
Any plans for subtitle support? It would be great if FFmpegSource eventually evolved into a total DirectShowSource (Video, Audio, Subtitles) replacement.

Myrsloik
4th February 2009, 18:56
No, never.

1. There is no support for it in avisynth, I really would like to be able to return multiple clips (arrays?) from a filter but you can't. There's also no decent way to pass subtitle data around apart from storing it in a clip (which will fail in the same way as directshow, skip beyond a subtitle starting point and you won't know it should appear).
2. There is only ONE good renderer. VSFilter. I would not try to reimplement this thing even if you paid me millions.
3. Directshow exists.
4. Why would I ever try to replace directshow with something as limited as avisynth? It makes no sense.
5. What's so difficult about using ffmpeg to demux the subtitles and then render then with VSFilter? Clever scripting and the "run exe files from avisynth" filter should be able to do it.

Mini trolling not appreciated. Do not bother to reply without good rebuttals to all points.

Sagekilla
5th February 2009, 02:46
Myrsloik, would it still be possible to return a clip with video + audio though?

I know you can do something like this, where you dub audio into the video:
v = Avisource("...")
a = Wavsource("...")

out = AudioDub(v,a)

But would it be possible to return video + audio as a single clip?

Myrsloik
5th February 2009, 08:08
Write a nice wrapper function, post it here (bonus points if you also write one for compatibility with v1). I don't see any reason because internally it would be identical to a simple avsi file with the function(s).

TheFluff
6th February 2009, 02:27
Write a nice wrapper function, post it here (bonus points if you also write one for compatibility with v1). I don't see any reason because internally it would be identical to a simple avsi file with the function(s).

function ffmpegsource2(string source, int "vtrack", int "atrack", bool "cache", \
string "cachefile", int "fpsnum", int "fpsden", string "pp", int "threads", \
string "timecodes", int "seekmode", bool "overwrite") {

vtrack = default(vtrack,-1)
atrack = default(atrack,-2)
cache = default(cache,true)
cachefile = default(cachefile,source+".ffindex")
fpsnum = default(fpsnum,-1)
fpsden = default(fpsden,1)
pp = default(pp,"")
threads = default(threads,-1)
timecodes = default(timecodes,"")
seekmode = default(seekmode,1)
overwrite = default(overwrite,false)

((cache == true) && (atrack <= -2)) ? ffindex(source=source, cachefile=cachefile, \
indexmask=0, overwrite=overwrite) : (cache == true) ? ffindex(source=source, \
cachefile=cachefile, indexmask=-1, overwrite=overwrite) : nop

v = ffvideosource(source=source, track=vtrack, cache=cache, cachefile=cachefile, \
fpsnum=fpsnum, fpsden=fpsden, pp=pp, threads=threads, timecodes=timecodes, \
seekmode=seekmode)

a = (atrack <= -2) ? blankclip(audio_rate=0) : ffaudiosource(source=source, \
track=atrack, cache=cache, cachefile=cachefile)

return audiodubex(v,a)
}

not very well tested

Parameters should be more or less self-explanatory (in most cases named identically to the ffms2 equivalents); overwrite controls whether the cachefile is overwritten or not if it already exists.

Almost completely backwards compatible with v1.

edit: dumb bug spotted, functionality commented out, watch this space for an edit

edit the second: dumb bug fixed. the fix made me realize that there is apparently no way to conditionally return from an avisynth function (the first version of this had something along the lines of "(atrack == -2) ? return v : nop" which of course didn't work because apparently return isn't a function).

edit the third: maybe I should just let atrack default to -2 like in ffms v1 and skip the try/catch block entirely.

edit the fourth: yeah that's a better idea

edit the fifth: fixed the last dumb bug, where overwrite=true wouldn't do anything if atrack==-2.

dansus
8th February 2009, 08:05
Hi, im try to open an H264 TS file with

FFVideoSource("D:\Enc\HD\hd.ts").Trim(200,0)

and i get;

Codec returned zero size video (source.avs line1)

I have a feeling im being stupid and missed something simple...

buzzqw
8th February 2009, 09:21
Have you try without trim ?

BHH

dansus
8th February 2009, 18:02
Yep.

Myrsloik said to you use Trim(200,0) or it wouldnt work. But not happy either way.

vlada
9th February 2009, 00:29
TheFluff>
I'm sorry for my very late feedback. Unfortunately I still can't get progress from ffmsindex.exe. I created a new extremely simple example which shows it. You only need Python (2.5 or 2.6) to try it. Please find the example here: http://www.sendspace.com/file/vq4rhc (if you prefer it uploaded somewhere else, please let me know).

The problem might be in the module (subprocess2.py) I use. It wasn't written by me, but it works perfectly with all other programs I tried (xvid_encraw, MPlayer, Mencoder, ffmpeg, MP4Box) on both Linux and Windows. Atak_Snajpera reported the same problem that I have.

Atak_Snajpera>
Does the ffmsindex.exe progress reporting work for you?

Myrsloik>
I have a file (*.m2v) which has a strange seeking problem with FFVideoSource(). I noticed that during my work on a script for automatic interlacing/telecine detection. As you can imagine, it is important to get the exact frames. But sometimes I get different frame then I want. For example if I seek to frame 100, I always get 101. Is this a known problem with elementary streams or are you interested in a test file?

Myrsloik
9th February 2009, 15:16
Hi, im try to open an H264 TS file with

FFVideoSource("D:\Enc\HD\hd.ts").Trim(200,0)

and i get;

Codec returned zero size video (source.avs line1)

I have a feeling im being stupid and missed something simple...

Cut off the first 10MB of the file or so and upload somewhere. That shouldn't happen. The Trim itself has nothing to do with video size.

TheFluff>
Myrsloik>
I have a file (*.m2v) which has a strange seeking problem with FFVideoSource(). I noticed that during my work on a script for automatic interlacing/telecine detection. As you can imagine, it is important to get the exact frames. But sometimes I get different frame then I want. For example if I seek to frame 100, I always get 101. Is this a known problem with elementary streams or are you interested in a test file?

I don't really support m2v files that much right now since dgindex usually works. There is a very similar issue for transport streams too. Upload a sample somewhere if you want me to look at it but as usual I'm insanely busy for at least another month so don't expect quick fixes.

I'll also try to find some ftp space for huge uploads soon so I don't have to deal with the useless free file hosts... Donations are very welcome.

ajp_anton
13th February 2009, 04:11
Sorry to "repeat" requests, but last time was half a year ago and you never said you won't do it... =)

Could you add a display for things like frame type, frame size (in bytes), and maybe other things that I don't need, like ffdshow's OSD?

Myrsloik
13th February 2009, 23:19
Your puny request was already partially implemented. The frame type is set on each time a new frame is requested and can be subtitled on to the frame using scriptclip (or used otherwise). Frame size is something I won't add. Pointless complexity since with b-frames there isn't a 1:1 relation really and size says nothing about quantizers (or any other quality measure) so adaptive filtering could be used.

REQUEST DENIED

poisondeathray
13th February 2009, 23:23
Vlada - I don't know if this will help you or if it even applies to your specific situation, but with .m2v elementary streams, I also noticed the weird scrubbing behaviour and found "seekmode=0" makes everything back in order

ajp_anton
14th February 2009, 04:04
The frame type is set on each time a new frame is requested and can be subtitled on to the frame using scriptclip (or used otherwise).Maybe it's just me but I can't see how this is done... it's nowhere in the documentation, the change log, and if it's in the source code I just don't understand it.

Myrsloik
14th February 2009, 09:47
The variable name is FFPICT_TYPE and I guess I missed to add it to the documentation...

ajp_anton
14th February 2009, 15:17
Thanks, that's why I missed it and had to ask again =)
Frame size isn't *that* important, just thought that if you did one of them, the other would pretty much come along.

ajp_anton
9th March 2009, 22:50
Problems I've encoutered with ffms2:
It seems to skip the 2nd frame. To get correct seeking, you have to seek back and forth a few times and then it will work until you reload the clip.
Indexing gives an "access violation" and ffmsindex.exe crashes on mkv files created by x264. x264-mp4 and mkvmerge-mkv works fine.
ffpict_type is one frame off (shows n-1'th frame instead of the n'th). This can be corrected with after_frame=true though.

Myrsloik
30th March 2009, 18:48
Problems I've encoutered with ffms2:
ffpict_type is one frame off (shows n-1'th frame instead of the n'th). This can be corrected with after_frame=true though.

This is by design in avisynth. You have to fetch a frame first, guessing which frame will be next is impossible. But it's good that you reported it and in the next version it should at least be documented properly. (next release is after a small change in ffmsindex is tested)

Myrsloik
30th March 2009, 19:05
FFMS2 beta 5 has been released. Some minor fixes but mostly released to have a fresher FFmpeg revision. I still haven't had time to go through the already reported bugs so no need to report them again.

Myrsloik
4th April 2009, 22:32
Finally had some time to look at a few bugs:
IK_-_WWW.flv: LAVF's seeking seems to be broken when you specify a timestamp in an audio track, so this one isn't my fault.
clipped-original.avi: Seems to have been fixed by updating ffmpeg.
sample-kemono.avi: XVID with n-vops. LAVC doesn't duplicate frames when encountering an n-vop and this one also triggers a bug with ffvfw. No idea how to solve it but a hack option could be added if there's a demand for it.

TS files are also known to still be weird in all ways possible.

Any other bugs should be reported again because now I've lost track.

Myrsloik
11th April 2009, 20:14
Another update. 2.00 beta 6 improves many things and having the haali splitter installed should now be seen as almost a requirement.

There is however one very big known issue remaining (exists in all versions) and that is mpeg4 videos with NVOPs which desync when they are encountered. I'm also getting tired of talking to myself so if others would consider talking to themselves in this thread it would also be appreciated.

lobosrul
11th April 2009, 21:24
I'm getting an AviSynth script error after upgrading to beta 6 "Evaluate: System Exception - Access Violation".

Beta 5 works as expected.

LoRd_MuldeR
12th April 2009, 01:34
I'm getting an AviSynth script error after upgrading to beta 6 "Evaluate: System Exception - Access Violation".

Beta 5 works as expected.

Yup, same problem here!

Myrsloik
12th April 2009, 13:40
The beta 6 archive has now been updated. For some reason vs2008 miscompiled the dll in release mode or so it seems. This time it has less optimizations enabled and should work. (unless it's really something bad ffmpeg does in which case you will now get a more random error)

LoRd_MuldeR
12th April 2009, 15:39
The beta 6 archive has now been updated. For some reason vs2008 miscompiled the dll in release mode or so it seems. This time it has less optimizations enabled and should work. (unless it's really something bad ffmpeg does in which case you will now get a more random error)

Thanks. I'll give it a try :)

TheFluff
12th April 2009, 15:43
By the way ffmsindex now has a -v flag. By default it suppresses all ffmpeg logging/warning output, use -v if you want to see it (will probably lead to spamming lots of "invalid and inefficient packed b-frames detected" with mpeg4 in avi).

b66pak
16th April 2009, 23:49
beta 6 and 5 generates invalid timecodes:

999832
999874
999916
999957
999999
1.00004e+006
1.00008e+006
1.00012e+006
1.00017e+006
1.00021e+006


it should be (beta 4):

999832
999874
999916
999957
999999
1000041
1000082
1000124
1000166
1000208
_

TheFluff
17th April 2009, 04:27
I believe I've fixed that one problem just now. Try this (very unofficial and not approved by Myrsloik) build and see if that fixes it: http://renji.se/files/fluff/aegisub/ffms2-20090417.7z

b66pak
17th April 2009, 17:56
it is ok now...thanks a lot...

this is for a 29.97 fps file...

999865.533333
999898.900000
999932.266667
999965.633333
999999.000000
1000032.366667
1000065.733333
1000099.100000
1000132.466667
1000165.833333
_

Myrsloik
24th April 2009, 12:11
A few bugs (enough to make it almost useless) were in the latest two releases and because of this I'll start doing a bit more structured testing... in the next version. Use beta 4 for now if you encounter any issues, a new version should be done within a week.

Myrsloik
29th April 2009, 18:10
FFMS2 beta 7. This one can actually request all frames in a clip with b-frames without crashing. Isn't it amazing what computers can do nowadays? It's also been inspected by the COM police (Haali).

There's also an application called ffms2rt.exe which takes a media file as its only argument. It then tries to create a full index with all audio tracks and sequentially requests all frames. Finally it outputs the md5 sum of all decoded frames if successful or the error returned by ffms2. Not sure how useful it is if you're not testing things.

LoRd_MuldeR
1st May 2009, 01:21
Thanks. Seems to work fine for me :)

ajp_anton
3rd May 2009, 00:41
Why do I need to go back to 1.21 to be able to open .mkv files made by x264?

TheFluff
3rd May 2009, 08:11
Because there was a bug that was recently fixed that made the matroska parser crash on MKV files that it couldn't determine the filesize of simply by reading their headers. I guess I could upload a new build for you if you wanted to, or you can just wait for the next beta release.

unranger
8th May 2009, 23:19
Problems I've encoutered with ffms2:
It seems to skip the 2nd frame. To get correct seeking, you have to seek back and forth a few times and then it will work until you reload the clip.


until FFMS2 b8 is officially released, you may want to check this page (http://www.mod16.org/hurfdurf/?page_id=19) and the document (http://svn.aegisub.net/trunk/aegisub/FFmpegSource2/ffms2.html) on the source page

Myrsloik
9th May 2009, 23:09
Beta 8. Yes. We. Like. Beta. Since unranger already spoiled the fun I had to go and do something else. There's also an experimental compile against ffmpeg-mt linked in the first post. I tried it on almost one file and won't have time to test it with more. Feel free to post your own experiences with it.

LoRd_MuldeR
10th May 2009, 03:11
Thanks. The new version seems to work, even with x264-encoded MKV files :)

Mottodj
10th May 2009, 07:00
Using FFVideoSource on x264-mkv MeGUI reports I420 colourspace, converting isn't option so how make yv12 output, or it's depend by source?

Myrsloik
10th May 2009, 12:03
Using FFVideoSource on x264-mkv MeGUI reports I420 colourspace, converting isn't option so how make yv12 output, or it's depend by source?

That is a bug in MeGUI. It hates things such as mpeg2source and similar for the same reason. I've never figured out why it has that useless restriction. And yes, in the case of ffvideosource the output format depends on what type the input is.

LoRd_MuldeR
10th May 2009, 12:36
x264 as wll as Xvid are exclusively limited to the YV12 colorspace. So unless your source is in that format, a colorspace conversion is unavoidable...

Myrsloik
10th May 2009, 13:05
You can't really distinguish between a compressed format being YV12 or I420 in my opinion. When so much rearranging is involved whoever writes the decoder will be deciding. The only difference is whether the U or V plane comes first when decoded and is stored in memory. Nothing else, so there is no conversion necessary and supporting both is trivial. Hence the big MeGUI mystery. All avisynth filters support both automatically.

LoRd_MuldeR
10th May 2009, 13:10
Well, MeGUI is nothing but a front-end that will call x264 with your Avisynth script. So if x264 expects the data in YV12 memory order, there's not much MeGUI can do about that.

But couldn't the problem be avoided easily by appending ConvertToYV12() to end of the script? From you explanation this should be a "lossless" conversion. Just some memory reordering...

Myrsloik
10th May 2009, 16:18
Yes and no, internally avisynth considers both formats to be the same (only avisynth really needs to know the difference since it handles actual frame allocation and final output). So IsYV12() will return true for both (confused yet?) and ConvertToYV12() will pass through the video unchanged since it already IsYV12(). As it is FFVideoSource will always return YV12-ish formats as I420 (forgot that until I looked at the source again). It should be trivial to flip it to "real" YV12 but I don't see why it's my problem.

LoRd_MuldeR
10th May 2009, 16:35
So internally Avisynth hides the difference between I420 and YV12. But doesn't I420 -vs- YV12 matter as soon as the data is passed to the host application, e.g. x264?

If the application expects the YV12 data to be in "real" YV12 memory order, but the data is actually delivered in I420 memory order, problems will occur...

TheFluff
10th May 2009, 16:38
So if x264 expects the data in YV12 memory order, there's not much MeGUI can do about that.

x264 itself has no problem with I420, neither does xvid_encraw or anything else really.

LoRd_MuldeR
10th May 2009, 16:39
x264 itself has no problem with I420, neither does xvid_encraw or anything else really.

Then now I see the problem. MeGUI complains about I420 although x264 would actually handle it just fine...

TheFluff
10th May 2009, 16:44
Yes, if you actually ever tried MeGUI (I never did) you can apparently just ignore that warning completely and it'll work just fine anyway so I have no idea why it's still there, people have been complaining about it for years.

It's probably because the MeGUI people don't understand what I420 is, because the warning offers to add ConvertToYV12() for you, and if you do that it just pops up again. If you just ignore the warning on the other hand it'll Just Work(tm). (of course it works with the ConvertToYV12() too since it's just a no-op)


edit: yep, the megui people definitely have no clue.
18:10:42 < Dark_Shikari> what everyone calls "YV12" is actually i420
18:11:05 < Dark_Shikari> x264 doesn't support the reverse chroma plane order because there's no f*ing point, i.e. it can be trivially switched in whatever input app you're using
18:11:10 < Dark_Shikari> and because practically nobody uses the alternate order

LoRd_MuldeR
10th May 2009, 19:11
Hopefully they read this and kill the unnecessary warning :)

Kurtnoise
10th May 2009, 22:18
yep, the megui people definitely have no clue.
why not pointing to the right direction instead of bashing people here ?

You think you are superior to the others ? come on...:rolleyes:

Blimblim
12th May 2009, 08:01
Hi everyone.

First of all thank you to Myrsloik for his wonderful work with ffmpegsource. It really simplified my life a lot.

I just wanted to mention that sorenson 3 mov files seem to be broken with the main ffvideosource since at least beta 6 (I was using 1.0 before that, and couldn't find beta 5 anymore). The interesting thing though is that it actually works with the new beta8-mt build. I guess this is a ffmpeg thing, but if I can help find this issue I'll be more than happy to help :)

Myrsloik
12th May 2009, 11:06
With that description it definitely sounds like some kind of ffmpeg issue. Could you provide a clip so I can use it in my (future) automated tests?

Blimblim
12th May 2009, 16:29
Of course :)
One of many : http://media.gamersyde.com/madworld_trailer2mov.mov
I get a Evaluate: System exception - Access Violation when I try opening it.

StifflerStealth
12th May 2009, 17:13
I am using the new Beta 8, but MPC crashes with this error:
Problem signature:
Problem Event Name: APPCRASH
Application Name: mplayerc.exe
Application Version: 1.2.1008.0
Application Timestamp: 49bfb5f5
Fault Module Name: FFMS2.dll
Fault Module Version: 0.0.0.0
Fault Module Timestamp: 4a05fbdc
Exception Code: c0000005
Exception Offset: 00001000
OS Version: 6.1.7100.2.0.0.256.1
Locale ID: 1033
Additional Information 1: 0a9e
Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
Additional Information 3: 0a9e
Additional Information 4: 0a9e372d3b4ad19135b953a78882e789


My avs script is:
FFmpegSource2("My.mkv", -1, -1)
#Version()
Info()

It's rather simple. I manually index it and it creates the Wave64 file for the audio, but that crashes as well. I delete all the index and wave files and let the script create it and it just creates the index file. Also, I tried using just the ffaudiosource part on the raw AAC files and that crashes. It doesn't crash when I use just the video, ie. setting -2 for audio track. Oh, it also crashes in giving it the actual track number for the audio as well, so there is something weird with the audio.

Myrsloik
12th May 2009, 18:23
Oh, it also crashes in giving it the actual track number for the audio as well, so there is something weird with the audio.

It's AAC audio. Just that simple fact can make FFmpeg puke very quickly. I've considered going back to compiling it with FAAD2 for AAC decoding instead but that would take at least 5 minutes of effort.

StifflerStealth
12th May 2009, 19:14
Okay. But, when the file is manually indexed, it makes a Wave64 file. Isn't that used instead of the Audio in the mkv file? :S If not, why is it created? Can it be used? That would stop the crashing, I guess.

Myrsloik
12th May 2009, 19:23
No, FFIndex treats dumping the audio linearly and indexing as two different things. Use something like RaWavSource (I think, consult the manual) to open the w64 file you get instead.

StifflerStealth
12th May 2009, 19:26
Will try that. But, will a future version support AAC in MKV files? That would be nice to have. :)

Thanks for your help!

TheFluff
12th May 2009, 22:36
Will try that. But, will a future version support AAC in MKV files? That would be nice to have. :)

Here (http://www.mod16.org/aegisub/ffms2-20090512.7z) is a compile from today (ffmpeg from last week sometime) with libfaad compiled in and ffmpeg's internal AAC decoder disabled. Should support all not terribly broken AAC. When it gets outdated, remember to yell at me and not at Myrsloik (unless he has started to build with libfaad again by then).

edit: it won't work with your existing ffmsindex.exe unfortunately, hope that isn't a problem because I'm too lazy to build and upload that too right now

StifflerStealth
13th May 2009, 11:29
Brilliant. Thanks. :) And I don't yell. ;) :P Now I'm off to try to deinterlace a film that seems to have random interlacing so a simple pulldown doesn't work ... :S Oh, the strange projects I choose to do.

StifflerStealth
13th May 2009, 14:41
edit: it won't work with your existing ffmsindex.exe unfortunately, hope that isn't a problem because I'm too lazy to build and upload that too right now How does one go about getting a ffmindex.exe that is compatible with this new build? :o

TheFluff
13th May 2009, 15:39
One compiles it from source and links to the ffms2.lib on SVN. Or one could get it here (http://www.mod16.org/aegisub/ffmsindex-20090513.7z) I guess.

StifflerStealth
13th May 2009, 15:57
I really should install a compiler. Does the free one from Microsoft work with this? But, I will try your link. :D Thanks again!

TheFluff
13th May 2009, 16:18
MSVC 2008 express (the free one) should work for something as simple as ffmsindex at least. Building the rest of ffms2, on the other hand, is rather nontrivial and involves compiling ffmpeg in mingw first.

StifflerStealth
13th May 2009, 18:06
I was afraid of that. XD

But, when I try to run ffms2index, the one I DLed from the link you gave, I get a popup saying:
The procedure entry point _FFMS_NoLog@0 could not be located in the dynamic link library FFMS2.dll

:S

TheFluff
13th May 2009, 19:35
That's bizarre, it shouldn't be looking for that symbol at all. Must've uploaded the wrong file or something. Delete both ffms2.dll and ffmsindex.exe and get this (http://www.mod16.org/aegisub/ffms2-20090513.7z) package with both dll and exe instead.

StifflerStealth
13th May 2009, 19:57
Still no luck. The pop up says for a title: "Entry Point Not Found." and then that message I posted earlier. I forgot to mention the popup box title before.

TheFluff
13th May 2009, 20:04
Works here, you're either running the wrong version (check your PATH for conflicting ones) or doing something wrong in general.

halsboss
15th May 2009, 14:20
Hello, can you please positively confirm whether or not it has a potential random access issue mentioned here http://forum.doom9.org/showthread.php?p=1285705#post1285705 (libavcodec broken for frame accurate random access) ? And whether or not it avoids the DSS2 issue quoted in the same thread ? I'll add a clarifying response in that thread accordingly.

Myrsloik
15th May 2009, 15:16
I don't see a very specific question but I'll answer something anyway...

Libavformat is one big random access issue just waiting to happen so that sounds about right. The difference is most likely how we treat it. FFMS2 seeks, looks at the returned timestamp, goes back further if it wasn't the intended frame to seek to and so on until it finally succeeds or throws an error (default behavior). Sometimes lavf is so inaccurate it can't match up. That's life. However FFMS2 always goes back to the previous GOP (if it succeeds at all) so that is not an issue. What DSS2 does I'm not really sure of. End of rambling...

I think they've proposed a new seeking API as a SoC project this year though...

TheRyuu
17th May 2009, 00:23
link removed see below (http://forum.doom9.org/showthread.php?p=1286806#post1286806)

A new version of ffms2-mt, this time compiled with pthreads instead of w32threads. Should now actually thread decoding of whatever ffmpeg-mt threads (i.e. h264).

Try it out, see what gets faster, see if it breaks, etc... ;)

halsboss
17th May 2009, 01:22
I don't see a very specific question but I'll answer something anyway...Thankyou for your response. I may have taken something out of context, however that's being fixed up by theFluff.

TheRyuu
18th May 2009, 09:01
Alright lets try this again...
link removed
See here... (https://forum.doom9.org/showthread.php?p=1302682#post1302682)

Please replace all old versions with this (if anyone actually got any of the old versions :p)

Also now compiled with libfaad for any aac people out there who wanted that.
On a side note, I have not been able to link pthreads statically so pthreadGC2.dll is included, throw that into system32, else ffms2 will not load.

swaaye
19th May 2009, 07:48
So I'm guessing here that FFmpegSource2 doesn't work on x64 OSs? I get exception errors with the latest compile above and the beta8 from the first post in the thread....

TheRyuu
19th May 2009, 10:41
So I'm guessing here that FFmpegSource2 doesn't work on x64 OSs? I get exception errors with the latest compile above and the beta8 from the first post in the thread....

My compile above is working my 64bit copy of vista just fine.
Are you using 64bit avisynth or something?

swaaye
19th May 2009, 17:13
Hmmm, no. I'm on Win7 x64 although I was also trying it on Vista x64 and having the same problem. I am working with a MKV containing VC1. Maybe there's something going on there?

First I use the separate ffms2index.exe to make the index file. Then I try to load it into AvsP with FFVideoSource("sourcefile") and avisynth throws out an exception error. I put the pthread dll into SysWoW64. I'm running Avisynth MT, if that matters (the script only contains ffvideosource though).

edit:
Is it possible that this is some sort of problem with accessing a ~20GB mkv?

TheRyuu
19th May 2009, 21:31
Hmmm, no. I'm on Win7 x64 although I was also trying it on Vista x64 and having the same problem. I am working with a MKV containing VC1. Maybe there's something going on there?

First I use the separate ffms2index.exe to make the index file. Then I try to load it into AvsP with FFVideoSource("sourcefile") and avisynth throws out an exception error. I put the pthread dll into SysWoW64. I'm running Avisynth MT, if that matters (the script only contains ffvideosource though).

edit:
Is it possible that this is some sort of problem with accessing a ~20GB mkv?

Try installing the vs2008 and 2008sp1 runtimes?

swaaye
19th May 2009, 22:17
Well I also tried letting ffvideosource index the mkv. It makes the index file but then promptly crashes. The mkv has the video on track 1, so I set that, but no help. There's no audio in the mkv. Tried threads = 1. Nada....

Next I demuxed the video out of the mkv and into a avi container. ffvideosource indexed it and them informed me that the codec could not be opened lol. Uhg. AVI plays fine in MPC.

TheRyuu
21st May 2009, 11:51
See here... (https://forum.doom9.org/showthread.php?p=1302682#post1302682)

Few SVN Updates.
Build environment now ICL.
pthreads now statically linked. No need for external DLL anymore.

Regarding Bugs/Issues:
Make sure to specify exactly what compile you are using when reporting a bug/issue.

Myrsloik
28th May 2009, 21:13
FFMS2 beta 9 changes the FFAudioSource behavior to actually index things correctly by itself in most cases (if it's invoked after FFVideoSource on the same file it will have to index it twice though). FFAudioSource now supports opening audio in ps/ts/ogm and there should be a lot less possible accessviolations. Also I've started to compile it with faad2 again. How can FFmpeg have such an incomplete aac decoder for so long?

Most other changes are in things that can't be seen like the API and general compiler compatibility. Remember that FFMS2 can be compiled and used as a library in almost every os like linux, freebsd, windows and macos.

TheRyuu will probably post an FFmpeg-mt compile soon.

The future plans are to create a GUI for selecting which tracks to index/dump in QT and to add support for uncompressed formats in non-lavf opened files. After that maybe something like incremental indexing but an avisynth filter could never benefit from it anyway...

LoRd_MuldeR
28th May 2009, 23:57
Myrsloik, it seems I cannot get audio (MP3 format) out of AVI files with FFMS2. I'm using Beta-9.

Myrsloik
29th May 2009, 09:39
I didn't touch that part and it works with one avi with mp3 here for me. An FFmpeg regression maybe? Provide a clip and I'll look at it.

LoRd_MuldeR
29th May 2009, 14:16
Here is the sample:
http://www.mediafire.com/file/4wuhzjng3yo/sample.ffms2.7z

Myrsloik
29th May 2009, 17:19
This was an interesting clip. What internally happens:
1. Seeking is required
2. The normal LAVF seeking method is called
3. A packet is attempted to be read but fails since 2 failed and the position is now at the file end?
4. No audio for you

For some reason it doesn't like your audio track. Adding AVSEEK_FLAG_ANY seems to make the seeking succeed on your clip but seems to introduce audible artifacts in my other mp3 in avi test clip. I think this is a LAVF bug so remux to mkv and enjoy life.

Myrsloik
29th May 2009, 17:31
Some more thinking produced this (http://ivtc.org/new/beta/FFMS2_mp3_in_avi_test.rar) compile. It should work on more clips like yours but without introducing any regressions at least. So much for seeking always succeeding in a simple avi...

LoRd_MuldeR
29th May 2009, 18:10
Thanks. I will test your new compile once I get home. I mist to leave now.

BTW: That AVI file was created with Avidemux.

Myrsloik
30th May 2009, 00:36
This is the full todo list for FFMS2. Vote on the features you want or suggest your own. I'm personally guessing 2-5 are what people want mostly but I could be wrong...

Todo

(Implemented) Make it possible to set the output colorspace easily (could be useful for files decoded to full resolution YUV or another format not directly supported by avisynth, implementation-wise related to 8)
(Implemented) Properly detect nvops so many normal xvid files can be decoded properly (I have no idea how, really)
(Implemented) Detect when the file the index is for has changed (will throw an error instead of being undefined for now)
Write a graphic indexing app using QT creator (it will look at least twice as good as DGIndex)
(Implemented) Show progress in haalisource indexing (assuming Haali reveals the secrets)
(Implemented) Make stream delays optional to include in the filenames from avisynth/have configurable filenames in some way
Support uncompressed formats and formats that need codec properties to be set from the container values properly (added width and height reading for all formats, currently only supported in LAVF opened files but wav in mkv/ts is so uncommon I don't think anyone's noticed)
(Implemented) Handle video with resolution changes (now I have samples, closely related to 1)
(Implemented) RFF flag support - not compatible with VFR but that's not my problem
Implement incremental indexing (this would be a pure API improvement and never show up in avisynth because of its limitations)
(Implemented) Use unicode for all opened and saved filenames
(Added API documentation/revised the avisynth manual) More documentation
(Implemented) Add VS2008 project files and cmake for all other systems to use
Regression tests
(Not my fault) Figure out why Haali's parser just stops on some huge transport streams (This is a bug in Haali's code and will be fixed in a later release of his splitter)
Add support for transport streams that do not start on a packet boundary with Haali's parser (I probably won't implement this but patches are welcome, it could still be useful to reduce the number of needed steps to open some files)
Make wrappers for using the FFMS2 library in other applications such as virtualdub and premiere import plugins if there's any real interest
Make all calls to SWScale and PP multithreaded
Export metadata information in the API (needed for 4 to be more user friendly)
Figure out why h.264 in TS/PS decoding shows artifacts
Implement raw mpeg 1/2/4 and h.264 parsers to support those input formats for more than linear reading
Dummy d2v file writing for use with rffmode=1+TFM
(Implemented) Improve the horribly inefficient index format, currently a ~5MB index becomes 20kb after zipping

TheFluff
30th May 2009, 00:47
2, 5, don't care about the rest

Chevy787
30th May 2009, 01:15
5,4, 12 (for added functions).
Some very nice ideas there Myrs.

jmartinr
30th May 2009, 08:26
2, 6, The automation would make it just a little bit easier to use. :)

LoRd_MuldeR
30th May 2009, 14:13
Some more thinking produced this (http://ivtc.org/new/beta/FFMS2_mp3_in_avi_test.rar) compile. It should work on more clips like yours but without introducing any regressions at least. So much for seeking always succeeding in a simple avi...

Yes, works fine :)

TheRyuu
2nd June 2009, 22:16
See here... (https://forum.doom9.org/showthread.php?p=1302682#post1302682)

Updated to latest ffmpeg-mt and ffms2 (beta 9) sources as of today.

Built with ICL 11 and includes static pthreads and libfaad.

Mr VacBob
3rd June 2009, 05:50
You can use AVCodecParser (see mpegvideo_parser.c) to discover field flags instead of having to do a complete decode.

Myrsloik
3rd June 2009, 10:14
Now give me a code sample too because I've looked at it before but couldn't figure out what the arguments are even supposed to be or if I created it correctly. Otherwise I'm just going to assume it's something old and forgotten in FFmpeg...

Mr VacBob
3rd June 2009, 16:28
av_parser_init(CODEC_ID_MPEG2VIDEO) -> set s->flags to PARSER_FLAG_COMPLETE_FRAMES -> av_parser_parse2 -> read s->repeat_pict?

I don't know what happens if you don't pass in real values for pts/dts/pos, though.
And why isn't av_parser_init documented, or called av_parser_open...

vlada
4th June 2009, 08:59
My vote: 2, 5, 4, 12

Adub
9th June 2009, 16:50
ffms2-mt-06022009.rar (http://sempai-net.com/ss-trainee/Dragon/ffms2-mt-06022009.rar)

Updated to latest ffmpeg-mt and ffms2 (beta 9) sources as of today.

Built with ICL 11 and includes static pthreads and libfaad.

Yes! Thank you so much for this! I was just looking for it when I came across this last page. Thanks for building it!

Edit: Okay, time for a bug report. When loading a Blu-ray M2TS file, 19.6 GB (21,077,882,880 bytes), I receive the following error upon completion of the indexing stage.

http://www.mirror.adubvideo.net/ffms2_bug.png

This is with the latest, ffmpeg-mt build by TheRyuu.

Video is H.264, 23.976 fps.

Script:
#DSS2("00000.m2ts")
FFVideoSource("00000.m2ts")

It seems that it works with a smaller sample as well.

Download, extract, and play the avs with the latest version of the ffmpeg-mt build.

www.mirror.adubvideo.net/ffms2bugsample.7z

saint-francis
9th June 2009, 19:45
Is the .m2ts playable? I can't play your sample in MPC.

Adub
9th June 2009, 19:53
Yeah, plays just fine in MPC HC 1127.

Myrsloik
9th June 2009, 20:26
I looked at the sample and can't explain it. For some reason it fails to decode even a single frame in the video which means the height/width can't be determined either. It "works" if lavf's ts splitter is used but then you have so many other issues it's not interesting anyway. Nice clip to have for future testing.

Adub
10th June 2009, 00:01
Damn. So no quick fixes, eh? And I was so excited to use a frame accurate ffmpeg-mt Avisynth source as well. What's weird is that it works just fine when using Haali's DSS2, and since you are using Haali's internal splitter, shouldn't it work just the same?

Myrsloik
10th June 2009, 00:37
Both yes and no, I only use the parser part through COM so slightly different behavior is to be expected (just like you don't see segment linking and all that fancy stuff for matroska). I think I'll have to ask Haali for ideas. Demuxing it to a raw stream makes it crash too. Is the clip corrupt?

And about your post in another thread, the mt compile doesn't have any known bugs that aren't also in the normal compile.

Adub
10th June 2009, 03:00
Yeah, I thought there were some bugs due to the clip at hand.

As for the clip being corrupt, it shouldn't be. I cut it with DGSplit directly from the .m2ts file. I have even converted the entire m2ts file to h.264 in MKV (using DSS2) and that went just fine.

TSMuxer (1.10.6) demuxes the clip just fine.

TheFluff
10th June 2009, 20:38
I finally got around writing some API docs (http://www.mod16.org/ffms2/ffms2-api.html) for FFMS2. Useful if you don't want to fight with ffmpeg to decode stuff in your program.

Myrsloik
21st June 2009, 16:30
As you can see if you look at the todo list the next beta is progressing nicely, or at least close to it. But to finish the API design, so others can begin to use FFMS2 as a library without weekly updates, I really need a clip where the resolution changes in the video. Without it it will be impossible to test any implementation. So if you have one don't hesitate to send it to me. I only need a small part where the transition actually happens.

Mr VacBob
21st June 2009, 17:32
http://samples.mplayerhq.hu/MPEG2/resolutionchange.mpg

AGDenton
26th June 2009, 21:57
Hi,

I've been using FFMS2 within x264 for a while, with very satisfactory results on various files. However, I've just found one which has particularily nasty effects :

vc1-crash.mkv (http://dl.free.fr/mHVT1TEMJ)

This VC-1 in MKV file actually corrupts the heap when you call FFMS_CreateVideoSource() on it, causing random crashes somewhere down the line. The odd thing is, ffmpeg itself can decode it without trouble !

This problem has actually already been encountered by some clever guys at the HandBrake forums (http://forum.handbrake.fr/viewtopic.php?f=4&t=8003). It turns out that, sometimes, the VC-1 codec does not set itself up properly when you call avcodec_open the first time : but it does work if you close it and open it again (this is what ffmpeg does).

Indeed, if I add
avcodec_close(CodecContext);
avcodec_open(CodecContext, Codec);

at line 96 in ffmatroskavideo.cpp, the file decodes properly.

I don't even know which codecs need this kind of double-opening, or when the ffmpeg application does it. But I thought you'd like to know.:)

AG

Myrsloik
26th June 2009, 23:00
This is obviously an FFmpeg bug. One of my evil minions may or may not bother to bring it to the attention of the relevant developers. In the future I suggest you report such issues at http://ffmpeg.org/bugreports.html because I don't want more ugly workarounds in my code either way.

TheFluff
27th June 2009, 02:55
I am the evil minion in question and I've reported it (https://roundup.ffmpeg.org/roundup/ffmpeg/issue1233).

Myrsloik
28th June 2009, 01:32
Hi,

I've been using FFMS2 within x264 for a while, with very satisfactory results on various files. However, I've just found one which has particularily nasty effects :

vc1-crash.mkv (http://dl.free.fr/mHVT1TEMJ)

This VC-1 in MKV file actually corrupts the heap when you call FFMS_CreateVideoSource() on it, causing random crashes somewhere down the line. The odd thing is, ffmpeg itself can decode it without trouble !

...

AG

I've fixed the decoding of that category of files (vc1 in mkv/ts) by setting the coded_width/height from the container values. (may fix a few other files too) The open and close fix is a horrible suggestion.

The things that are left before the next release is to add some kind of NVOP fix/hack so it can be tested and for Haali to take a look at big ts files that hang while indexing. Maybe also a small bit of internal testing...

A new compile with the VC1 fix can be downloaded from http://ivtc.org/new/beta/FFMS2_vc1_fix_test.rar
It also has a lot of other changes so if you encounter any other new bugs feel free to report them as well.

Jorsher
28th June 2009, 09:40
i like applesauce

Myrsloik
28th June 2009, 10:00
"Hello there! I have an unspecified script I won't tell you about! Now guess what it does!"

7ekno
2nd July 2009, 15:09
Hi ya :)

Just wanted to report another instance of "Codec returned zero size video" in VirtualDub, AvsP and MPC ...

Same errror when invoked with FFMS2() or FFVideoSource() ...

Example clips (MTS with AVC video and AC3 audio, straight from a Panasonic AVCHDlite device):
00000.MTS (http://www.mediafire.com/file/vjzytkenzyi/00000.MTS.rar), 00001.MTS (http://www.mediafire.com/file/lmhn2zzigmg/00001.MTS.rar), 00002.MTS (http://www.mediafire.com/file/madjydtjjx0/00002.MTS.rar)

Can anybody suggest a possible fix using FFMS2, as they work with FFMpegSource(), DSS2() and AVCSource(), but I would prefer an FFMS2_MT version for speed (MT and standard FFMS2 throw the same error)!!

Thanks,
Tek

Myrsloik
2nd July 2009, 20:47
Hi ya :)

Just wanted to report another instance of "Codec returned zero size video" in VirtualDub, AvsP and MPC ...

Same errror when invoked with FFMS2() or FFVideoSource() ...

Example clips (MTS with AVC video and AC3 audio, straight from a Panasonic AVCHDlite device):
00000.MTS (http://www.mediafire.com/file/vjzytkenzyi/00000.MTS.rar), 00001.MTS (http://www.mediafire.com/file/lmhn2zzigmg/00001.MTS.rar), 00002.MTS (http://www.mediafire.com/file/madjydtjjx0/00002.MTS.rar)

Can anybody suggest a possible fix using FFMS2, as they work with FFMpegSource(), DSS2() and AVCSource(), but I would prefer an FFMS2_MT version for speed (MT and standard FFMS2 throw the same error)!!

Thanks,
Tek

I found a typo in the code so in the next release you'll get an access violation instead...

After that I looked at the real problem which looks similar to other clips I've seen before. Sometimes in transport streams it can't decode a single frame when Haali's splitter is used. I have no idea exactly what causes it. The reason 1.x can open it is that it uses LAVF instead. Then I tried opening it with LAVF's splitter intead of Haali's and it now "works" with seekmode!=1 after I found another typo in the code...

So I guess I'll make it possible to force using LAVF when creating indices with FFIndex() in the next version. That should at least give you working linear access. Or did 1.x work better than that?

TheRyuu
5th July 2009, 02:45
ffms2-mt-04072009.rar (http://sempai-net.com/ss-trainee/Dragon/ffms2-mt-04072009.rar) (beta 10ish)

Ditched ICL for now.
Compiled with gcc 4.4.0 + msvc.
Includes libfaad and opencore-amr.

ffms2, ffmpeg-mt, and opencore all updated to this day.

Myrsloik
12th July 2009, 13:28
A new version with more experimental fixes. Should fix h264 in TS like in this post http://forum.doom9.org/showthread.php?p=1302028#post1302028 (despite the name too). It also fixes a typo in the code for setting the width/height in the previous VC1 fix. If there are any regressions, especially that h264 files in TS stop working, make sure to report it.

Get it from http://ivtc.org/new/beta/FFMS2_vc1_fix2_test.rar

Note that there is still an issue that stops VC1 in TS streams from working (need to ask Haali when he reappears). Indexing of huge TS files can still hang but Haali has managed to reproduce it.

7ekno
14th July 2009, 08:08
A new version with more experimental fixes. Should fix h264 in TS like in this post http://forum.doom9.org/showthread.php?p=1302028#post1302028 (despite the name too).

Yep, worked perfectly, thanks for looking into it!!

I find for some reason FFMPEGSource2 more reliable on AVCHD sources (motion seems smoother in final transcoded MKV for some reason) .. Now where is TheRyuu with a -MT version :P

Thanks,
7ek

saint-francis
14th July 2009, 20:03
My troublesome VC-1 file fails right away with this one with a message saying the "FFVideoSource: Could not open video codec".

:(

LoRd_MuldeR
15th July 2009, 23:26
My troublesome VC-1 file fails right away with this one with a message saying the "FFVideoSource: Could not open video codec".

:(

Same here with my FFV1 source. I'm back to Beta-9 :)

Myrsloik
17th July 2009, 22:36
Same here with my FFV1 source. I'm back to Beta-9 :)

Is this a regression? Did your files work with beta9? If yes, could you upload a short sample of one of those files?

LoRd_MuldeR
17th July 2009, 23:26
Is this a regression? Did your files work with beta9? If yes, could you upload a short sample of one of those files?

Yes, it works perfectly fine with Beta-9. But it fails with Beta 10ish ("Could not open video codec").

Sample:
http://www.mediafire.com/file/tzqcoznudut/ffvh_sample.7z

Myrsloik
21st July 2009, 18:24
Yes, it works perfectly fine with Beta-9. But it fails with Beta 10ish ("Could not open video codec").

Sample:
http://www.mediafire.com/file/tzqcoznudut/ffvh_sample.7z

Now you've confused me. Your previous message said FFV1, but you sample is clearly FFVHuff. Not only that, it works perfectly for me.

Myrsloik
21st July 2009, 18:47
Beta 10 is out. It's very similar to the previously vc1 fix but with a slightly newer ffmpeg compiled in and some ffmsindex changes.

Look at the front page for a full list of changes but mostly it amounts to vc1 in mkv and h264 in ts fixes that will be noticed. And the much requested progress indication for ts files in ffmsindex, can't forget that one.

I've also added a donate button on my website (see my signature) and in the FFMS2 manual. I'd appreciate if you use it but don't panic or feel pressured, the development shall go on matter what happens.

Emess
21st July 2009, 18:52
From the FFMS2 channel at rizon.net: "Your download includes all current versions of the program at no cost. Also, please note that only one download is required to enable all of my ffms2 tools. You don't need to take multiple downloads."

IMO an incredible bargain given all that Myrsloik has given to enthusiasts (for free) already...

E~

TheFluff
21st July 2009, 18:54
I modified ffmsindex a bit; you can now use the -p switch to disable progress reporting, or repeat the -v switch to get more ffmpeg spam if you like that. The max number of meaningful instances of -v is four, which gives you AV_LOG_DEBUG (more spam than anyone would ever want).

LoRd_MuldeR
21st July 2009, 18:58
Now you've confused me. Your previous message said FFV1, but you sample is clearly FFVHuff. Not only that, it works perfectly for me.

In fact I was confused :D

I thought the "Could not open video codec" error happened with one of my FFV1 samples, but in fact it happenes (reproducible!) with the provided FFVHuff sample.

FFV1 is okay, even with the "Beta 10ish" build. Anyway, I will test the "official" Beta-10 as soon as possible and report back...

LoRd_MuldeR
21st July 2009, 20:09
In fact I was confused :D

I thought the "Could not open video codec" error happened with one of my FFV1 samples, but in fact it happenes (reproducible!) with the provided FFVHuff sample.

FFV1 is okay, even with the "Beta 10ish" build. Anyway, I will test the "official" Beta-10 as soon as possible and report back...

Okay, there is no problem with my FFVHuff sample under FFMS2 Beta-10. Great work :thanks:

LoRd_MuldeR
22nd July 2009, 22:11
Here is a MPEG-2 sample that FFVideoSource (Beta-10) rejects to open:
http://www.mediafire.com/file/1l5ntj0lyh5/dvb_sample.zip

It was captured from DVB-S. MPlayer and VLC do play it just fine. Also both, Avidemux and VirtualDub (with MPEG-2 plugin), do open that file just fine.

saint-francis
22nd July 2009, 23:32
Oh, you did it! My difficult VC-1 file works now!

Thank you very much!

TheRyuu
23rd July 2009, 22:05
ffms2-mt-b10-3.rar (http://sempai-net.com/ss-trainee/Dragon/ffms2-mt-b10-3.rar)

Finally got everything install on Windows 7 so here's that mt compile.

Built with GCC 4.4.0 (-march=i686 -mtune=generic) and MSVC 2008.
Includes opencore-amr, pthreads, and libfaad (all linked statically).

Edit: updated to latest ffmpeg-mt.

Edit2: does not fix the ffvhuff issue, but that has been solved (waiting on something else to post that).

Edit3: Now with 100% more ffvhuff decoding.

LoRd_MuldeR
23rd July 2009, 23:33
ffms2-mt-b10.rar (http://sempai-net.com/ss-trainee/Dragon/ffms2-mt-b10.rar)

That build once again has the "Could not open video codec" error with my FFVHuff sample. No such problem with Myrsloik build.

Is it possible that you did not include all the decoders? Or FFmpeg-MT is simply incomplete at this time?

Myrsloik
23rd July 2009, 23:41
That build once again has the "Could not open video codec" error with my FFVHuff sample. No such problem with Myrsloik build.

Is it possible that you did not include all the decoders? Or FFmpeg-MT is simply incomplete at this time?

My guess is that it was fixed (and broken) very recently in ffmpeg itself. Because of that those changes haven't been merged to ffmpeg-mt yet. Forgetting a decoder when compiling is very hard...

LoRd_MuldeR
24th July 2009, 00:00
Well, I will stick with your Beta-10 build then. It works fine for my FFVHuff clips. Being able to use the MT decoders, especially for my AVC clips, would be nice though ;)

BTW: The MT build fails on my MPEG-2 (http://forum.doom9.org/showpost.php?p=1307643&postcount=566) sample too (same for the "normal" build). So files of that kind can't be used with FFmpegSource at all...

TheRyuu
24th July 2009, 10:22
See here... (http://forum.doom9.org/showthread.php?p=1307962#post1307962) (4 posts up, link edited)

Now with 100% more ffvhuff decoding.

sl1pkn07
26th July 2009, 22:47
hello

how to install this program on linux?

compile fine bus make install not works:

sl1pkn07@SpinFlo:~/aplicaciones/FFmpegSource-2.00b10_src$ sudo make install
make: *** No hay ninguna regla para construir el objetivo `install'. Alto.



build

sl1pkn07@SpinFlo:~/aplicaciones/FFmpegSource-2.00b10_src$ cmake . -DCMAKE_INSTALL_PREFIX=/usr
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- checking for module 'libavformat'
-- found libavformat, version 52.36.0
-- checking for module 'libavcodec'
-- found libavcodec, version 52.32.0
-- checking for module 'libavutil'
-- found libavutil, version 50.3.0
-- checking for module 'libavdevice'
-- found libavdevice, version 52.2.0
-- checking for module 'libswscale'
-- found libswscale, version 0.7.1
-- checking for module 'libpostproc'
-- found libpostproc, version 51.2.0
checking: avformat.h
found: /usr/include/libavformat
checking: avcodec.h
found: /usr/include/libavcodec
checking: avutil.h
found: /usr/include/libavutil
checking: avdevice.h
found: /usr/include/libavdevice
checking: swscale.h
found: /usr/include/libswscale
checking: postproc.h
-- Found ZLIB: /usr/lib/libz.so
-- Looking for include files CMAKE_HAVE_PTHREAD_H
-- Looking for include files CMAKE_HAVE_PTHREAD_H - found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found Faad: /usr/lib/libfaad.so
-- Configuring done
-- Generating done
-- Build files have been written to: /home/sl1pkn07/aplicaciones/FFmpegSource-2.00b10_src
sl1pkn07@SpinFlo:~/aplicaciones/FFmpegSource-2.00b10_src$ make
Scanning dependencies of target FFMS2Core
[ 5%] Building C object CMakeFiles/FFMS2Core.dir/src/core/matroskaparser.c.o
[ 10%] Building C object CMakeFiles/FFMS2Core.dir/src/core/stdiostream.c.o
/home/sl1pkn07/aplicaciones/FFmpegSource-2.00b10_src/src/core/stdiostream.c: En la función ‘InitStdIoStream’:
/home/sl1pkn07/aplicaciones/FFmpegSource-2.00b10_src/src/core/stdiostream.c:107: aviso: asignación desde un tipo de puntero incompatible
/home/sl1pkn07/aplicaciones/FFmpegSource-2.00b10_src/src/core/stdiostream.c:108: aviso: asignación desde un tipo de puntero incompatible
/home/sl1pkn07/aplicaciones/FFmpegSource-2.00b10_src/src/core/stdiostream.c:109: aviso: asignación desde un tipo de puntero incompatible
/home/sl1pkn07/aplicaciones/FFmpegSource-2.00b10_src/src/core/stdiostream.c:110: aviso: asignación desde un tipo de puntero incompatible
/home/sl1pkn07/aplicaciones/FFmpegSource-2.00b10_src/src/core/stdiostream.c:111: aviso: asignación desde un tipo de puntero incompatible
/home/sl1pkn07/aplicaciones/FFmpegSource-2.00b10_src/src/core/stdiostream.c:112: aviso: asignación desde un tipo de puntero incompatible
/home/sl1pkn07/aplicaciones/FFmpegSource-2.00b10_src/src/core/stdiostream.c:113: aviso: asignación desde un tipo de puntero incompatible
/home/sl1pkn07/aplicaciones/FFmpegSource-2.00b10_src/src/core/stdiostream.c:114: aviso: asignación desde un tipo de puntero incompatible
/home/sl1pkn07/aplicaciones/FFmpegSource-2.00b10_src/src/core/stdiostream.c:115: aviso: asignación desde un tipo de puntero incompatible
[ 15%] Building CXX object CMakeFiles/FFMS2Core.dir/src/core/ffaudiosource.cpp.o
[ 21%] Building CXX object CMakeFiles/FFMS2Core.dir/src/core/ffhaaliaudio.cpp.o
[ 26%] Building CXX object CMakeFiles/FFMS2Core.dir/src/core/fflavfaudio.cpp.o
[ 31%] Building CXX object CMakeFiles/FFMS2Core.dir/src/core/ffmatroskaaudio.cpp.o
[ 36%] Building CXX object CMakeFiles/FFMS2Core.dir/src/core/ffvideosource.cpp.o
[ 42%] Building CXX object CMakeFiles/FFMS2Core.dir/src/core/ffhaalivideo.cpp.o
[ 47%] Building CXX object CMakeFiles/FFMS2Core.dir/src/core/fflavfvideo.cpp.o
[ 52%] Building CXX object CMakeFiles/FFMS2Core.dir/src/core/ffmatroskavideo.cpp.o
[ 57%] Building CXX object CMakeFiles/FFMS2Core.dir/src/core/ffms.cpp.o
[ 63%] Building CXX object CMakeFiles/FFMS2Core.dir/src/core/wave64writer.cpp.o
[ 68%] Building CXX object CMakeFiles/FFMS2Core.dir/src/core/utils.cpp.o
[ 73%] Building CXX object CMakeFiles/FFMS2Core.dir/src/core/indexing.cpp.o
[ 78%] Building CXX object CMakeFiles/FFMS2Core.dir/src/core/ffhaaliindexer.cpp.o
[ 84%] Building CXX object CMakeFiles/FFMS2Core.dir/src/core/fflavfindexer.cpp.o
[ 89%] Building CXX object CMakeFiles/FFMS2Core.dir/src/core/ffmatroskaindexer.cpp.o
Linking CXX shared library libFFMS2Core.so
[ 89%] Built target FFMS2Core
Scanning dependencies of target ffmsindex
[ 94%] Building CXX object CMakeFiles/ffmsindex.dir/src/index/ffmsindex.cpp.o
Linking CXX executable ffmsindex
[ 94%] Built target ffmsindex
Scanning dependencies of target ffmstest
[100%] Building CXX object CMakeFiles/ffmstest.dir/src/test/ffmstest.cpp.o
Linking CXX executable ffmstest
[100%] Built target ffmstest
sl1pkn07@SpinFlo:~/aplicaciones/FFmpegSource-2.00b10_src$ sudo make install
[sudo] password for sl1pkn07:
make: *** No hay ninguna regla para construir el objetivo `install'. Alto.
sl1pkn07@SpinFlo:~/aplicaciones/FFmpegSource-2.00b10_src$ sudo make install
make: *** No hay ninguna regla para construir el objetivo `install'. Alto.
sl1pkn07@SpinFlo:~/aplicaciones/FFmpegSource-2.00b10_src$

Emess
27th July 2009, 00:22
It's not implemented yet. You can manually copy libffms2core.so and any built binaries to where you need them, in /usr/{,local}/{bin,lib}/, use what is needed by your distro. At the moment ffms2 is provided mainly as a l use in your own projects, rather than an installable package.

E~

TheFluff
27th July 2009, 00:25
The unix build system wasn't really completed, there aren't very many except the Aegisub project that actually uses FFMS2 on unix, so the install command wasn't actually ever implemented (it's going to be now that you pointed it out, though).

If you want to do the installation manually in the meantime, copy libffms2core.so to $prefix/lib, include/ffms.h to $prefix/include, and ffmsindex & ffmstest to $prefix/bin. (ffmstest really isn't useable at all right now though, so you might as well skip that one.)

e: f, b

Myrsloik
27th July 2009, 01:03
hello

how to install this program on linux?

compile fine bus make install not works:

sl1pkn07@SpinFlo:~/aplicaciones/FFmpegSource-2.00b10_src$ sudo make install
make: *** No hay ninguna regla para construir el objetivo `install'. Alto.
...

Get the latest revision from svn and try again, it should install properly now.

sl1pkn07
27th July 2009, 02:12
thanks. but the 2.00b10 version works on aegisub.

aegisub not compile with ffmpegsorurce svn

Myrsloik
27th July 2009, 18:32
thanks. but the 2.00b10 version works on aegisub.

aegisub not compile with ffmpegsorurce svn

Just use replace the old CMakeLists.txt with the new one then. I should compile if you do that.

TheFluff
28th July 2009, 11:12
Aegisub has its own ffms2 on SVN, you should use that. If you for some reason really want to build aegisub with an external ffms2 newer than beta 10, it should be possible since r3294 (from yesterday).

Myrsloik
3rd August 2009, 00:00
VC1 in TS files now works. USE IT!
http://ivtc.org/new/beta/FFMS2_vc1_fix3_test.rar

It also has FFmpeg compiled with 32 as the max number of streams instead of 20 and will use LAVF instead of Haali's splitter if it isn't installed.

Note that a lot of refactoring was done since beta10 so there may be a few new bug lurking somewhere.

TheRyuu
4th August 2009, 02:12
ffms2-mt-03082009.rar (http://sempai-net.com/ss-trainee/Dragon/ffms2-mt-03082009.rar)

Svn build as of today (i.e. fixed vc1 decoding, etc...)

ffmpeg-mt had one minor update fixing the huff decoding problem (i.e. fixing the mt part instead of me just disabling the threading).
Other then that it is the same.

Built with:
MSVC 2008 (FFMS2)
GCC 4.4.0 (ffmpeg and libraries (libfaad, opencore, static pthread))

Taqyon
4th August 2009, 17:12
Hi Guys

I'm trying to open a VC-1 file or M2TS file, but I get a codec error in VirtualDub.

My script:

LoadPlugin ("C:\Program Files\AviSynth 2.5\plugins\ffms2.dll")
FFVideoSource("c:\Test.m2ts")

I'm using the build "ffms2-mt-03082009.rar".

Thanks

Myrsloik
4th August 2009, 18:00
Hi Guys

I'm trying to open a VC-1 file or M2TS file, but I get a codec error in VirtualDub.

My script:

LoadPlugin ("C:\Program Files\AviSynth 2.5\plugins\ffms2.dll")
FFVideoSource("c:\Test.m2ts")

I'm using the build "ffms2-mt-03082009.rar".

Thanks

Give. Me. A. Sample. Now.

moviefan
5th August 2009, 15:42
I have indexed a .264 raw file stream with the ffmsindex.exe file and thus created a .ffindex index-file. When I load the .264 video stream and the cache file like this:

FFVideoSource("file.264", cachefile="file.264.ffindex")

and the files are named like this, the index seems to be recreated... When I load this script into VirtualDub, there's no picture for a long time. What's wrong???

Edit: Now after a long time, VirtualDub reports "video track is unseekable"... Oh, and by the way, probably a very long-term suggestion (and I know this is really challenging): It would be really extremely great, if FFmpegSource was GPU assisted and not only by Nvidia cards, but also by ATI cards, so the code would have to be in either OpenCL or CUDA and ATI Stream... That would be totally amazing.

Myrsloik
5th August 2009, 17:18
I have indexed a .264 raw file stream with the ffmsindex.exe file and thus created a .ffindex index-file. When I load the .264 video stream and the cache file like this:

FFVideoSource("file.264", cachefile="file.264.ffindex")

and the files are named like this, the index seems to be recreated... When I load this script into VirtualDub, there's no picture for a long time. What's wrong???

Edit: Now after a long time, VirtualDub reports "video track is unseekable"... Oh, and by the way, probably a very long-term suggestion (and I know this is really challenging): It would be really extremely great, if FFmpegSource was GPU assisted and not only by Nvidia cards, but also by ATI cards, so the code would have to be in either OpenCL or CUDA and ATI Stream... That would be totally amazing.

That's because the stream is unseekable. The parser in LAVF does not support it, the end. Use seekmode=-1 if you really need to do it that way or mux it into a real container like mkv or mp4. Indexing will always work because it doesn't have to seek at all.

Now for a refresh in GPU (de)coding. ATI's stream is dead. DEAD. What you call "CUDA" is nvidia only and is using their decoder chip. Looking at the dgdecodeNV stuff I'm not impressed by the limitations at all. Also I hate nvidia so unless someone sends me a good set of SLI cards I'd never bother. OpenCL isn't available yet so good luck with that...

The only currently working acceleration built into FFmpeg is more or less linux+nvidia only. I think they're going to add yet another video acceleration API but windows support has never been one of their big strenghts. You're most likely better off investing in a threescoresofcores cpu and using the FFmpeg-mt builds, they're very stable nowadays.

Summary: I'd rather make something that works but thanks for asking

Myrsloik
8th August 2009, 17:05
Another small change with possibly big effects to test... This time it's a fix for the NVOPs found in many xvid files which would throw off linear decoding. It appears to work on all of my test files but it's still possible that some encoders for random reasons write their NVOPs differently, and it may still break in those cases.

http://ivtc.org/new/beta/FFMS2_nvop_fix_test.rar

Bumsfalara
9th August 2009, 11:09
Could someone please tell me how to use the SWScale function properly?

My avisynthscript looks like this:

LoadPlugin ("C:\Program Files (x86)\AviSynth 2.5\plugins\ffms2.dll")
FFVideoSource("F:\Dokumente\DVDFab\test.mkv", cachefile="F:\Dokumente\DVDFab\test.ffindex").SWScale(width =1280, height =720, resizer = "SPLINE", colorspace="YV12")

I always get the following error:
AviSynth script error:
SWScale: Context creation failed
*blahblah*


I looked into the documention: It seems that Swscale needs some input that is called "clip". The Problem is: I have no idea what i meant by this.


Thanks for your help

LoRd_MuldeR
9th August 2009, 11:18
"clip" is the implicit first argument of each Avisynth function.

If you call Foobar().SWScale(...), then "clip" will be the return value of Foobar(), so you don't need to set "clip" explicitly here.

Of course you could also do it like this:
c = Foobar()
SWScale(clip = c, ...)

However I'm getting the same "SWScale: Context creation failed" error when trying to use SWScale(). Not sure what it means...

Myrsloik
9th August 2009, 15:34
Could someone please tell me how to use the SWScale function properly?


"SWScale: Context creation failed" is the generic unknown error message and it was caused by trying to pass incorrect flags to it. I'll post another test version with the fix once I finish implementing the last part of the RFF flag support. (I hate force film, do you?)

Myrsloik
12th August 2009, 01:31
A new test version for you. No opencore-amr compiled in this time though. No ffmsindex.exe either because it needs to be updated too.

http://ivtc.org/new/beta/FFMS2_rff_test.rar

The main news are RFF flag support. This means you can now throw away DGDecode for most encoding purposes and DGAVCSource if you're encoding from the mkv or mp4 containers. The new setting is called rffmode where 0=ignore flags, 1=honor pulldown flags and 2=force film. (don't use force film, instead use tfm(d2v=...) or something, maybe I'll add fake d2v writing some day)

It also changes the behavior on indexing when errors are encountered when decoding audio to possibly be more compatible. There should be no change in behavior for completely correct files. The FFPP and SWScale avisynth filters also have a bug fixed that would cause them to not work or use other settings than specified.

TEST IT AND REPORT THE RESULTS ON YOUR FAVORITE VOB OR FILE WITH AUDIO THAT WOULDN'T INDEX BEFORE.

thewebchat
13th August 2009, 19:27
Is this because "force film" mode doesn't work in FFMS2 or is it because you want everyone to run TFM on progressive frames?

Myrsloik
13th August 2009, 20:43
Is this because "force film" mode doesn't work in FFMS2 or is it because you want everyone to run TFM on progressive frames?

It's because force film is quite a bad idea. Unless it truly is 100% undeniably film everywhere guaranteed exactly (in which case ignoring the pulldown flags will have the same effect, btw). Consider these two scenarios:

What happens if you use TFM(d2v=...) and honor pulldown flags is that it will take its matches from the d2v. Only in the irregular ntsc portions (or portions where the match using the field suggested by the d2v is horribly bad, I assume) will it revert to good old field matching. Combine with TDecimate and you have something that can properly handle slight irregularities.

What happens with force film is that you ignore every single pulldown flag when creating the output. Instead you just check to see if you need to duplicate or drop a frame as encoded in the source to keep the total number of frames intact. The result is that one single "interlaced" frame/orphaned field in the source will almost unconditionally be present in all its eye cancer glory.

Force film is just there to make it feature complete. Never use it if you have a choice. Also, my implementation can handle frame duplication and tripling unlike the DG tools (just a small note, I've never seen a stream that actually does it).

mavinashbabu
14th August 2009, 16:11
Hi,

I had downloaded FFMpeg binaries from Google Code Downloads link. I copied .dll's, .exe and .avsi to \Avisynth\Plugins\ folder, i get error Avisynth is not installed make sure it is installed first, and same error if i copy them into \windows\system32 folder except for .avsi file.

Can i get help here if i have to make it work? i am using DSS() and i was adviced to use FFVideoSource() instead of DSS().

Thanks
Avinash

Myrsloik
15th August 2009, 14:01
Hi,

Nothing that makes sense here...

Thanks
Avinash

Step 1: Include all relevant information
Step 2: Hope that someone cares

I have no idea what you did but it's not right. Stop putting random things in system32. What says avisynth isn't installed? Did you even install avisynth?

mavinashbabu
15th August 2009, 21:12
hi,

Thanks for the reply.

I have Avisynth installed and is working fine.

I downloaded FFMS from this link http://ffmpegsource.googlecode.com/files/FFmpegSource-2.00b10.rar

I opened archive and copied ffms2.dll and ffmsindex.exe from archive and copied it to Avisynth\plugins folder, but when i say FFVideoSource("Media_File_Name") or FFMpegSource2() i get error saying saying "there is no function named" for both the functions

Then i copied ffms2.avsi i try to use above functions FFVS() or FFMs2(), i get avisynth not installed error, but it is.

Then i put the ffms2.dll and ffmsindex.exe in \windows\system32 folder thought it would help, but i got the same error messages as above.

I hope i am clear in explaining.

Thanks,
Avinash

TheFluff
15th August 2009, 21:16
I opened archive and copied ffms2.dll and ffmsindex.exe from archive and copied it to Avisynth\plugins folder, but when i say FFVideoSource("Media_File_Name") or FFMpegSource2() i get error saying saying "there is no function named" for both the functions

What happens if you say loadplugin("X:/whateverfolder/ffms2.dll") at the top of the script (replace the path with the one on your computer, obviously)?

SEt
15th August 2009, 21:16
Feature request: export variable with true time of current frame. Would be best to have it also as string like info().

ffms2.avsi in the release is missing '\' at the end of line 6.

mavinashbabu
15th August 2009, 21:22
What happens if you say loadplugin("X:/whateverfolder/ffms2.dll") at the top of the script (replace the path with the one on your computer, obviously)?

Thanks for the tip, i will try and reply back

Myrsloik
15th August 2009, 21:24
Feature request: export variable with true time of current frame. Would be best to have it also as string like info().

ffms2.avsi in the release is missing '\' at the end of line 6.

How do you want that to be exported? I don't think a float will be precise enough and there are no doubles in avisynth. What about rational form like it's stored? It would mean timebase numerator, denominator and the multiple of that. Or just as an int with the number of ms elapsed since the clip start?

I don't like to export things as strings, there's always one more formatting option you have to add. It's material for ffms2.avsi if anything.

The missing \ has been fixed in the RFF test already.

mavinashbabu
15th August 2009, 21:31
If i say this --> Loadplugin("C:\Program Files\AviSynth 2.5\plugins\ffms2.dll")

It works for FFVideoSource() but FFmpegSource2() still says There is no function named "FFMpegSource2()"

Thanks,
Avinash

TheFluff
15th August 2009, 21:36
If i say this --> Loadplugin("C:\Program Files\AviSynth 2.5\plugins\ffms2.dll")

It works for FFVideoSource() but FFmpegSource2() still says There is no function named "FFMpegSource2()"

For the latter to work you need to say import("C:\Program Files\AviSynth 2.5\plugins\ffms2.avsi") at the top of the script.

In either case it looks like your autoloading is broken. Either you edited the registry value to point somewhere else, or something else did.

edit: or maybe you have two avisynth installations in different places or something

SEt
15th August 2009, 21:41
No floats please if possible. Num/den ints are ok, probably should add total duration too.

About the string: i want it as light and simple way to print on the frame so something like "hh:mm:ss.ttt" with no options, if someone would need fancy formating - it can be done from ints. I kind of dislike what would have to be done inside ScriptClip instead of one line in source.

mavinashbabu
15th August 2009, 21:59
For the latter to work you need to say import("C:\Program Files\AviSynth 2.5\plugins\ffms2.avsi") at the top of the script.

In either case it looks like your autoloading is broken. Either you edited the registry value to point somewhere else, or something else did.

edit: or maybe you have two avisynth installations in different places or something

Hi,

Registry i did not touch at all, and as far as multiple installations of Avisynth i do keep folders and files as backups for but in different drives, but none on where OS installed drive.

I installed Avisynth only once so far and i am using the same installation from 6 months or so. All other plugins in "plugins" folder gets autoloaded automatically though.

I searched for "Avisynth" string in registry all i could see is entries for C:\Windows\system32\Avisynth.dll and C:\Program Files\Avisynth\plugins folders only.

Regards,
Avinash

7ekno
25th August 2009, 03:28
A new version with more experimental fixes. Should fix h264 in TS like in this post http://forum.doom9.org/showthread.php?p=1302028#post1302028 (despite the name too).

Spoke too soon ;)

FFMS2 is only reporting 25fps, when the streams are actually 50fps with duplicate frames!

I know, I know, it's a technicality, but when the streams are encoded at 25fps they appear "more jerky" than those encoded at 50fps with duplicates!! Have even blindly asked a few random people as they walk by my workstation ;)

DSS2() is what I am using to get the right reported 50fps and duplicates atm ...

For clarity, we are talking about these streams:
00000.MTS (http://www.mediafire.com/file/vjzytkenzyi/00000.MTS.rar), 00001.MTS (http://www.mediafire.com/file/lmhn2zzigmg/00001.MTS.rar), 00002.MTS (http://www.mediafire.com/file/madjydtjjx0/00002.MTS.rar)

7ek

Myrsloik
25th August 2009, 09:46
Your claim makes no sense but I've investigated it anyway. As you say it's really a 25 fps video, the repeats don't seem to be flagged in any particular way either. Because of the overly general system in ffmpeg for reporting repeated fields/frames there's no actual way to detect it if all have the same repeat flag. On the other hand it's also pointless because then your file has a lower real fps and you're not missing anything.

May i suggest interleave(last, last) if you find duplicates so attractive?

7ekno
26th August 2009, 11:59
May i suggest interleave(last, last) if you find duplicates so attractive?

But frames 0 and 1 are different, 1 and 2 are the same, as are 3 and 4, etc ;)

So while interleave(last,last) will duplicate the frames, it won't actually replicate the original stream ...

Sorry, thought the idea was to actually have a filter that adhered to new emerging standards (AVCHDlite) and be ahead of the game ;)

Won't go into the dynamics of LCD screens and "pixel hold times" relating to the human perception of "jerkiness" as a defense for the 50fps preference ;)

7ek

canTsTop
26th August 2009, 13:57
FFmpegSource is reporting 49,945 fps on my 25fps sample atk_sample_0.ts (Downlod here (http://www.mediafire.com/?sharekey=0d21c08fd364c52f61d4646c62b381cb6816bd8ecd1727af5621d66e282a0ee8))
Using this version: ffms2-r192-2.rar
Index with this command ffmsindex atk_sample_0.ts -t -1
avs script:
a=FFAudioSource("atk_sample_0.ts")
v=FFVideoSource("atk_sample_0.ts")
AudioDub(v,a)


And ffmsindex complaining that libiomp5md.dll is missing, had to download from internet

LoRd_MuldeR
26th August 2009, 13:58
But frames 0 and 1 are different, 1 and 2 are the same, as are 3 and 4, etc ;)

So while interleave(last,last) will duplicate the frames, it won't actually replicate the original stream ...

If 1 and 2 are the same, 3 and 4 are the same and so on, while 0 and 1 are different, 2 and 3 are different and so on, then your stream consists of pairs of identical (duplicated) frames.

That's exactly what interleave(last,last) would do, starting from a stream that contains no duplicates...

Myrsloik
26th August 2009, 15:58
But frames 0 and 1 are different, 1 and 2 are the same, as are 3 and 4, etc ;)

So while interleave(last,last) will duplicate the frames, it won't actually replicate the original stream ...

Sorry, thought the idea was to actually have a filter that adhered to new emerging standards (AVCHDlite) and be ahead of the game ;)

Won't go into the dynamics of LCD screens and "pixel hold times" relating to the human perception of "jerkiness" as a defense for the 50fps preference ;)

7ek

What is the standard exactly? I thought it was only a fancier name for avc in mp4 at moderately high resolutions. I'm also goign to dispute the whole concept of "original stream" because I do return every single frame. Of course this reply won't make you any happier but if you can find anything about the actual stream differences that would at least help me explain everything.

The missing runtime dll is caused by TheRyuu for some inexplicable reason compiling stuff with ICL even if it will have absolutely no performance difference in the end. I'll go blame him. I'll take a look at the sample you posted later today...

TheRyuu
26th August 2009, 22:53
What is the standard exactly? I thought it was only a fancier name for avc in mp4 at moderately high resolutions. I'm also goign to dispute the whole concept of "original stream" because I do return every single frame. Of course this reply won't make you any happier but if you can find anything about the actual stream differences that would at least help me explain everything.

The missing runtime dll is caused by TheRyuu for some inexplicable reason compiling stuff with ICL even if it will have absolutely no performance difference in the end. I'll go blame him. I'll take a look at the sample you posted later today...

Yes blame me. :)

http://ffmpegsource.googlecode.com/files/ffms2-r197.rar
Should fix your problem (same archive includes both ffmpeg-mt and regular ffmpeg builds now).

LoRd_MuldeR
26th August 2009, 23:03
What is the standard exactly? I thought it was only a fancier name for avc in mp4 at moderately high resolutions.

AVCHD is to H.264 what Video-DVD is to MPEG-2. Or in other words: AVCHD uses a subset of H.264. It puts additional restrictions on what resolutions, framerates and bitrates are allowed. Also it defines what audio formats can be used (AC-3 and L-PCM). And it defines the container level. But AFAIK the container used by AVCHD is not MP4 (ISO Media), but MPEG-2 Transport Stream.

diizzy
27th August 2009, 17:41
@ 7ekno
I have the same issue (I don't think mine really are 25i though). The clips are played back correctly in MPC-HC but reported as 25 fps in tsmuxer, MPC-HC and ffmpegSource.
Only eac3to detects it correctly but after muxing ffmpeg plays it back way too fast no matter what I do.
//Danne

Ghostlamer
29th August 2009, 19:28
Hello, when i use resizer = "BICUBIC" , avisynth tells "the named argument resizer to ffmpegsource2 has wrong type..
I use ffmpegsource svn r197.

My Script:
ffmpegsource2("C:\Users\Ghostlamer\Desktop\DBZ\TEMP\DBZ 182.mkv", vtrack = -1, atrack = -1, width = 470, height = 264, resizer = "BICUBIC", threads= 4)
TextSub("C:\Users\Ghostlamer\Desktop\DBZ\TEMP\DBZ 182_Track4.srt")

thewebchat
29th August 2009, 22:03
From FFMS2.avsi:
function FFmpegSource2(string source, int "vtrack", int "atrack", bool "cache", \
string "cachefile", int "fpsnum", int "fpsden", string "pp", int "threads", \
string "timecodes", int "seekmode", bool "overwrite", int "width", int "height", \
int "resizer", string "colorspace", int "rffmode", int "adjustdelay") {
Change that to string "resizer".

TheFluff
29th August 2009, 22:36
fixed in svn now, thanks for the report

Ghostlamer
30th August 2009, 08:17
From FFMS2.avsi:

Change that to string "resizer".

I change that and function FFImageSource(string source, int "width", int "height", int "resizer", string "colorspace"), now it tells FFAudioSource: Audio track contains no audio frames.
When i use (640x480,1024x768,1280x1024 resize) it loads with audio track, when i use like 720x480 it display that message..
Or when i use only video without audio, it loads with current resize to 470x264.

Updated:
I used SWScale function for resize and now its works with 470x264..

Is any differece between SWScale function resizing and resizing in first string ffmpegsource2(" width = , height = , resizer = "") ?

Myrsloik
30th August 2009, 13:04
I change that and , now it tells FFAudioSource: Audio track contains no audio frames.
When i use (640x480,1024x768,1280x1024 resize) it loads with audio track, when i use like 720x480 it display that message..
Or when i use only video without audio, it loads with current resize to 470x264.

Updated:
I used SWScale function for resize and now its works with 470x264..

Is any differece between SWScale function resizing and resizing in first string ffmpegsource2(" width = , height = , resizer = "") ?

Your problem makes absolutely on sense. There is no way the video can have any effect on the audio. Post the exact script you used and possibly a sample too.

Yes, there is a difference in certain cases.
1. If the clip has a different colorspace than what avisynth supports for output
2. If the clip has colorspace and resolution changes you can select what you want as output instead of using the settings of the first frame

canTsTop
31st August 2009, 19:19
FFmpegSource is reporting 49,945 fps on my 25fps sample atk_sample_0.ts (Downlod here (http://www.mediafire.com/?sharekey=0d21c08fd364c52f61d4646c62b381cb6816bd8ecd1727af5621d66e282a0ee8))
Using this version: ffms2-r192-2.rar
Index with this command ffmsindex atk_sample_0.ts -t -1
avs script:
a=FFAudioSource("atk_sample_0.ts")
v=FFVideoSource("atk_sample_0.ts")
AudioDub(v,a)


Any news about this? same problem with version ffms2-r197

Thank You

Myrsloik
31st August 2009, 22:31
Any news about this? same problem with version ffms2-r197

Thank You

That clip is so broken it hurts. This is plainly unsupported, do not expect a video file with ZERO keyframes to ever work well. It's a bad omen. Also all the other evidence suggests that the clip really is 50fps and nothing else.

SO I'M RIGHT AND YOU'RE WRONG! HA! Bet you didn't see that one coming.

Based on these observations:

In MPC the communistic propaganda clearly syncs up with the talking heads
In mplayer (the penguin propaganda tool, that is) it is incorrectly detected as 25 fps and that obviously desyncs very quickly
Playtime duration is identical between MPC and VDub at 50 fps, framestepping in MPC hints at the same
Setting rffmode=1 gives you 50 fps
Seeking is horribly broken anyway because there are no keyframes and probably something else that's bad with the stream
LISTS ARE AWESOME!
Can someone try my donation button? Tell me if it worked after you've sent me some money. That would be a big help.

canTsTop
1st September 2009, 20:28
Thank You for replay. DGAVCIndex, Avidemux 2.6 report 25.00 fps for that sample. If no keyframes is problem, here is another sample with keyframes with_idr.ts (http://www.mediafire.com/?nzzdmzjzmyy), ffms2-r197 reports it as 28.538 fps

Myrsloik
1st September 2009, 20:41
Thank You for replay. DGAVCIndex, Avidemux 2.6 report 25.00 fps for that sample. If no keyframes is problem, here is another sample with keyframes with_idr.ts (http://www.mediafire.com/?nzzdmzjzmyy), ffms2-r197 reports it as 28.538 fps

Did you use rffmode=1? It changes the framerate "calculation" too.

canTsTop
1st September 2009, 20:58
if i add rffmode=1 to avs, reported fps is 50 fps, and video duration ~46 seconds, playing to fast. in mpc video duration is 1min 22seconds

EDIT:
if i add AssumeFPS(25, sync_audio=false) at bottom of script, everything seems to be ok
a=FFAudioSource("with_idr.ts")
v=FFVideoSource("with_idr.ts",rffmode=1)
AudioDub(v,a)
AssumeFPS(25, sync_audio=false)
is this method is correct? will i lose video information?

TheFluff
1st September 2009, 23:24
rffmode=1 will never remove any frames; only add them (it can repeat fields if the stream flags tells it to). neither will assumefps(), since it only changes timestamps, not frames. so yeah, it should be safe to say that you will not lose any information. the question is if the result is what you actually want, though...

canTsTop
2nd September 2009, 11:58
If i add AssumeFPS(25, sync_audio=false) at bottom of script, video duration is 1min 32sec instead of 1min 22sec. If i play that script in mpc audio/video synchronization is good and video/audio stops after 1min 22sec, other 10 seconds is just silence and no video. But if i seek in mpc this script a/v synch is lost, and i can seek to 1min 30sec and see video.

vlada
4th September 2009, 10:50
Hi,
I have a problem with accented characters and FFmpegSource.

First problem is, that ffmsindex from CLI fails with file stored in path with accented characters. I tried to encode the command to cp895, cp852. cp1250, iso-8895-2 and utf-8. None of them worked. Most programs work with cp1250 encoding.

The same problem appears if I use accented characters with FFVideoSource in an .avs script. Again I tried all possible encodings and none of them worked. AVISource or DirectShowSource work in cp1250 encoded scripts.

Myrsloik
4th September 2009, 11:20
FFmpeg does not support unicode on windows. Avisynth does not support unicode anywhere. This is not the thread for you.

TheFluff
4th September 2009, 13:17
You can actually get unicode support from ffms2 on windows, but only if you use the C++ API directly, and only if you compile it against a patched FFmpeg (the patch is in /etc on the ffms2 svn trunk). It will not work through Avisynth. ffmsindex.exe does not support unicode commandlines at all; it only supports the system local encoding.

vlada
4th September 2009, 13:50
I know about the lack of unicode support. That's not what I'm asking for. But I would like to make it work with system encoding (which is cp1250 in my case). But as soon as I use any non ASCII characters (such as ě,š,č,ř,ž etc.), it will fail.

Myrsloik
4th September 2009, 18:24
I know about the lack of unicode support. That's not what I'm asking for. But I would like to make it work with system encoding (which is cp1250 in my case). But as soon as I use any non ASCII characters (such as ě,š,č,ř,ž etc.), it will fail.

The string from avisynth is passed unmodified to ffmpeg. Use short filenames if you really have to open weirdly named files or submit a patch. I may look at it again the day ffmpeg adds utf8 support (without patching) on windows because I'm too lazy to distribute modified sources.

Myrsloik
6th September 2009, 11:02
2.11 is now released. Read the changelog carefully.


Now 100% less beta
FFMSIndex can now write timecode files
Optimized index reading and writing, file opening should be faster especially for big files
Fixed a crash bug on zlib compressed streams in matroska
Added an argument to FFAudioSource that makes it automatically adjust the delay relative to the first video track (default), the specified track (any track type possible) or relative to the zero timestamp, no adjustment is done for files with no video track in the default mode
Now exports the colorimetry info in a format easily usable with ColorMatrix, see FFCOLOR_SPACE and FFCOLOR_RANGE in the manual, the reported information may be unreliable
Added an FFImageSource() function to ffms2.avsi which invokes FFVideoSource with the optimal settings for use on images
Now exports the actual frame presentation time in FFVFR_TIME, added the general information function FFInfo() and FFFormatTime() functions to ffms2.avsi in addition to fixing the missing backslash
The seek/read method has been changed in the matroska video source to only need the information in the index and nothing more, this matches the audio source and should make seeking faster in some cases
No longer drops the last audio frame
It is now possible to force indexing of broken tracks when using FFIndex and from the API, this can in many cases help when the last frame of an avi file is corrupted which would otherwise prevent indexing of all working data
Fixed a bug that would prevent the SWScale and FFPP filters from working because of randomly added flags
Added support for RFF flags, the three possible modes should be equivalent to the ones found in DGDecode
Added a workaround for mpeg4 files with NVOPs
Fixed a bug where the first frame would be corrupted if the colorspace/dimensions were set for the output
Now VC1 in TS decoding works in many cases
Added the missing install target to CMake and changed the default output library name (Kovensky)
Now reverts to using LAVF if Haali's splitter isn't installed (note that LAVF is VERY bad at seeking in these formats)
Now requires the boost headers (but not libraries) to compile because boost::format is so convenient
More API changes to return proper error codes and more source cleanups
Updated FFmpeg to rev 19776, FFmpeg-mt to 24/08/2009 - with faad2, opencore-amr nb/wb, and w32threads (pthreads for FFmpeg-mt)

vlada
6th September 2009, 20:24
The string from avisynth is passed unmodified to ffmpeg. Use short filenames if you really have to open weirdly named files or submit a patch. I may look at it again the day ffmpeg adds utf8 support (without patching) on windows because I'm too lazy to distribute modified sources.

Thanks for the idea to use short filenames. It seems to work perfectly so far.

And btw. many thanks for the new version of FFMS2.

dream-lx
7th September 2009, 19:52
Hi,

First of all thanks for ffmpegsource. It is really very usefull.

I used ffmpegsource in order to open xdcam MP4 files. Version 2.10 supported the files without any problem. 2.11 gives me the following error: out of bound track index selected. FFVideoSource seems to work. The problem seems to occur at the FFAudioSource statement. I have noticed that the same problem occurs for HDV m2t files. If you are interested to look into it please tell me what tests to do. If you would like to have the original file, please tell me and I will put in online for you.

Thanks in advance

Myrsloik
7th September 2009, 19:57
It's a known bug (I guess). Setting adjustdelay=-3 in FFAudioSource should fix it. I'll wait a few more days in case any other obvious problems are found and then release 2.12.

dream-lx
7th September 2009, 23:11
Hi,

I tried adjustdelay=-3 without success. However I have tried to call FFIndex(filename) before FFVideo(filename) and FFAudio(filename) and in this case it works pefectly for xdcam MP4 files. However also using this way, FFAudioSource is still not working for HDV m2t files. FFVideSource is working perfectly. For FFAudioSource the error message is now "Audio track contains no audio frames". The audio track contains mpeg-2 audio and is playable by ffplay. I have also tried the m2t files with the previous version. The previous version also didn't also handle them correctly.

Thanks in advance

Myrsloik
7th September 2009, 23:18
What are HDV m2t files? Can you provide one as a sample?

Atak_Snajpera
8th September 2009, 00:00
What are HDV m2t files?
created by HDV camcorders (Transport Stream <- Mpeg2 + mp2 Audio)

dream-lx
8th September 2009, 05:37
Hi,

While trying to prepare you an m2t file, I have discovered that some files works and others not. Unfortunately the nonworking files are 2gbytes long. I will try to reproduce the problem with smaller files during the next days and I will then report back. As a temporary work around, I found that ffmpeg -i error.m2t -vcodec copy -acodec copy good.m2t seems to solve the problem. The files having problems have been grabbed from tape using dvgrab under linux. The ones that don't have problems have been taken from a flash recorder from a Z7.

Myrsloik
8th September 2009, 16:22
You can binary cut transport streams so just cut the first 20MB or so of a non-working file. Check so it's still not working in the same way and put it somewhere.

dream-lx
8th September 2009, 16:46
I have thought at exactly the same thing, but if I binary cut the first 8 megabytes, everything works flawlessly so I think there is something in the middle confusing it. I will start tests now and report back soon.

dream-lx
8th September 2009, 17:36
I think there is something wired going on in dvgrab/ffmpeg as with other m2t files grabbed by dvgrab, I have other problems like: video steem not seekable. If I start to read the tape 1 sec later, everything works fine. I have tested in linux in kdenlive and the same clips having problem with ffmpegsource also seem to have problems in kdenlive. I think I will first make a bugreport for dvgrab not that we are trying to resolve a bug that isn't in ffmpegsource.

Myrsloik
8th September 2009, 22:12
Did you install Haali's splitter? If not you should really do so and delete all .ffindex files.

Blue_MiSfit
9th September 2009, 08:47
Thanks so much for all your efforts, Myrsloik (and others involved)!!

This is a truly wonderful swiss army knife of a source filter! I use it all the freaking time, and it's wonderfully stable and DirectShit free :D

~MiSfit

Myrsloik
11th September 2009, 23:17
2.12 - mixed bug fixes and one small feature

Added support for (L)PCM in TS/PS
Fixed some possible memory corruption on initialization in the indexers
Improved the API slightly by making resolution and colorspace frame properties only like they actually are
Fixed adjustdelay=-1 when no video track is present, previously it would crash
Updated FFmpeg to rev 19824, FFmpeg-mt unchanged at 24/08/2009 - with faad2, opencore-amr nb/wb, and pthreads


I guess this should be considered quite stable. Maybe...

thewebchat
12th September 2009, 00:27
timecodes output produces some strange results when used on VOBs like the one in this post (http://forum.doom9.org/showpost.php?p=1324089&postcount=16). Some frames have durations of 0 in the output timecodes like this:

# timecode format v2
0.000000
66.733333
66.733333
133.466666
166.833333
166.833333

Is this expected?

Myrsloik
12th September 2009, 01:53
It's known and expected, kinda. Haali's parser tries to interpolate times but isn't that good at it. But VOB/TS rarely (never) are VFR anyway so it isn't really a problem. Or are you doing something weird?

thewebchat
12th September 2009, 02:21
Well, I know of several DVDs that are encoded with mainly 24p/RFF and some 30p/60i sections. I figured that, since parts that are already progressive shouldn't be ivtc'd, I would use the timecodes output to search for the non-film sections. Now, I know that I could just set rffmode=1 and do it the old way, but I figured, since FFMS2 is a new and advanced software, I could use hybrid operation on VOBs.

Myrsloik
12th September 2009, 10:40
IF you want to do something like that I'd suggest that you also make a d2v for the same file. Then write a small program to generate a proper set of timecodes from that. I guess I should add fake d2v generation/some other way to export the rff stuff (already on the todo list).

saint-francis
13th September 2009, 15:43
This (http://www.mediafire.com/?sharekey=1f010a972ed14ad0d956df2962098fcb6c140e682a9e54115621d66e282a0ee8)file fails with ffvideosource. All kinds of artifacts.
Sorry, I couldn't get it to load in tsremux for the desired method of cutting.

Myrsloik
13th September 2009, 23:58
This (http://www.mediafire.com/?sharekey=1f010a972ed14ad0d956df2962098fcb6c140e682a9e54115621d66e282a0ee8)file fails with ffvideosource. All kinds of artifacts.
Sorry, I couldn't get it to load in tsremux for the desired method of cutting.

No extension and adding .ts doesn't seem to make mpc any happier...

Despite this setback of grand proportions I will still try to diagnose your problem. I think your problem is that you didn't read the list of known issues.

henryho_hk
19th September 2009, 12:32
When we rip a DVD on file basis, we will get a number of (actually splitted) files like VTS_01_1.VOB, VTS_01_2.VOB, VTS_01_3.VOB .... Can I tell ffindex(), ffvideosource(), etc to open them as a whole?

LoRd_MuldeR
19th September 2009, 16:18
Why not simply use the "+" operator in your Avisynth script?

kemuri-_9
19th September 2009, 16:49
Why not simply use the "+" operator in your Avisynth script?

he's looking for something similar to SegmentedAviSource (http://avisynth.org/mediawiki/SegmentedAviSource)
frankly i think it would just be easier to disable VOB splitting when ripping the dvd to the pc.

henryho_hk
20th September 2009, 05:49
"+" is not a good option because DVD VOBs are not cut at I-frames most of the time. Hence, the 2nd and onwards will have some frames missing at the start. To decode splitted VOBs correctly (& continuously) they must be decoded as if they were one single file.

Is re-ripping the only option? Mencoder and ffmpeg offer some syntax to specify a volume inside a DVD directory.

LoRd_MuldeR
20th September 2009, 11:55
Why not use DGIndex? It allows you to select multiple (VOB) files and store the result as a single D2V file, which you can load via MPEG2Source().
http://neuron2.net/dgmpgdec/dgmpgdec.html

henryho_hk
20th September 2009, 12:37
Coz dgindex.exe is making problematic WAV when demuxing LPCM tracks in rare cases. Also, the integrated deinterlace and resize filters of ffvideosource() is sometimes preferred due to their high speed.

LoRd_MuldeR
20th September 2009, 12:44
Coz dgindex.exe is making problematic WAV when demuxing LPCM tracks in rare cases.

Die you report the problem to Neuron2 and provide a sample? Also DVD's with LPCM audio are pretty rare, I think...

Also, the integrated deinterlace and resize filters of ffvideosource() is sometimes preferred due to their high speed.

If you need a fast and still reasonable-quality deinterlacer, I highly recommend to give Yadif a try!

Anyway, FFmpegSource also contains the FFPP() function, so you can apply the "built-in" potsprogressing/deinterlacing to any source...

Myrsloik
20th September 2009, 14:04
"+" is not a good option because DVD VOBs are not cut at I-frames most of the time. Hence, the 2nd and onwards will have some frames missing at the start. To decode splitted VOBs correctly (& continuously) they must be decoded as if they were one single file.

Is re-ripping the only option? Mencoder and ffmpeg offer some syntax to specify a volume inside a DVD directory.

Binary concatenation of the files should work. Submitting a patch will also work if you want to do it that way. All you need to do is provide a replacement COM object that maps several files into a single contiguous one instead of the standard one used now (this is only for haali's ps/ts splitter of course).

henryho_hk
22nd September 2009, 06:54
I found something interesting with ffaudiosource (b12). Suppose I use dgindex.exe to save a d2v project and decode the ac3 track into wav. The script is something like this:

v1=mpegsource("film123a.d2v", cpu=4).TempGaussMC_beta1mod(tr2=2) # slow!
a1=wavsource("film123a.wav")
p1=audiodub(v1,a1).trim(0,v1.framecount-1) # ensure same video and audio length
v2=mpegsource("film123b.d2v", cpu=4).TempGaussMC_beta1mod(tr2=2) # slow!
a2=wavsource("film123b.wav")
p2=audiodub(v2,a2).trim(0,v2.framecount-1) # ensure same video and audio length
(p1+p2)

Then I use bepipe.exe to convert the audio track into MP3:

bepipe.exe --script "import(^film123.avs^)" | lame.exe -S --noreplaygain --preset cbr 192 - film123.mp3

The audio extraction runs very quickly.

But if I convert WAV track into FLAC and load it with ffaudiosource():

ffindex("film123a.flac")
ffindex("film123b.flac")
v1=mpegsource("film123a.d2v", cpu=4).TempGaussMC_beta1mod(tr2=2) # slow!
a1=ffaudiosource("film123a.flac")
p1=audiodub(v1,a1).trim(0,v1.framecount-1) # ensure same video and audio length
v2=mpegsource("film123b.d2v", cpu=4).TempGaussMC_beta1mod(tr2=2) # slow!
a2=ffaudiosource("film123b.flac")
p2=audiodub(v2,a2).trim(0,v2.framecount-1) # ensure same video and audio length
(p1+p2)

Then the bepipe audio extraction will run very slowly, as if TempGaussMC_beta1mod() had got invoked. But it should not be the case because Avisynth should be delivering video or audio frames on-demand only.

Does anyone have similar experience?

Gavino
22nd September 2009, 09:56
The slowness must come from ffaudiosource. As you say, there should be no video frames requested from the clip and hence from TempGaussMC_beta1mod.

Try adding KillVideo() to your script, or replacing Import(...) by Import(...).KillVideo() - it should make no difference, showing the problem is on the audio path.

tebasuna51
22nd September 2009, 15:53
I think ffaudiosource must decode the flac file writting a .w64 decompressed file, this process is not needed with wav input file.

Myrsloik
22nd September 2009, 17:46
I found something interesting with ffaudiosource (b12). Suppose I use dgindex.exe to save a d2v project and decode the ac3 track into wav. The script is something like this:

...

Then the bepipe audio extraction will run very slowly, as if TempGaussMC_beta1mod() had got invoked. But it should not be the case because Avisynth should be delivering video or audio frames on-demand only.

Does anyone have similar experience?

This is probably some kind of caching bug, I'll try to reproduce it later.

martinfrombern
6th October 2009, 21:06
I'm currently backuping bluray I recently got. eac3to reports the main stream as VC1 60i. I muxed vc1 stream (from m2ts) into mkv container, and decided to load the video using ffmpegsource2 (2.12), because I need a frame accurate loading. However, when I try to see a how it looks like in AvsP, it takes a minute or two (I suppose to index it) and then displays completely black image (of proper dimensions - 1920x1080). And this is the case with whichever frame I try. The playback works perfectly well using mpc+ffdshow (wmv9 for vc1 decoding). Any help please?
Unfortunately, cannot provide a sample, since mkvmerge seems to mess it up even more (causes AvsP to crash) when splitting it :(

poisondeathray
6th October 2009, 21:18
^What happens when you use it on .m2ts stream (instead of putting into mkv)? Maybe try cutting segment with tsmuxer instead?

Myrsloik
6th October 2009, 22:49
I believe you encountered this issue or something similar to it (eac3to muxed mkv with vc1 video B0RK):
http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2009-October/076766.html

It should work in the next release if that is the case.

martinfrombern
6th October 2009, 23:05
^What happens when you use it on .m2ts stream (instead of putting into mkv)? Maybe try cutting segment with tsmuxer instead?with m2ts same story, except there is grey screen, instead of black one :(
here is short sample, but please keep in mind that this one crashes avsp on mine computer, so i don't know whether it reflects the problem i'm actually dealing with (it was created with tsmuxer).
http://www.mediafire.com/?sharekey=9c0a4fe1e50fc1f41f8e0fff488e27e0e04e75f6e8ebb871

EDIT: @Myrsloik: thank you for your response. If it's of any help (I suppose not, but still...), the source is planet earth (extra disc).

martinfrombern
7th October 2009, 02:57
update: When I feed ffmpegsource2 with demuxed vc1 stream (from original m2ts file) i get error "Video track is unseekable." So it seems that the problem is in vc1, and not in the fact that this is in a specific container (e.g. mkv) :(

LoRd_MuldeR
7th October 2009, 03:11
update: When I feed ffmpegsource2 with demuxed vc1 stream (from original m2ts file) i get error "Video track is unseekable." So it seems that the problem is in vc1, and not in the fact that this is in a specific container (e.g. mkv) :(

Did you try one of the alternative seek modes offered by FFVideoSource? These should get some streams to work that won't work otherwise...

Myrsloik
7th October 2009, 10:14
update: When I feed ffmpegsource2 with demuxed vc1 stream (from original m2ts file) i get error "Video track is unseekable." So it seems that the problem is in vc1, and not in the fact that this is in a specific container (e.g. mkv) :(

Raw streams are by definition quite unseekable. What did you expect after stripping all timestamps and other hints?

martinfrombern
7th October 2009, 13:10
Raw streams are by definition quite unseekable. What did you expect after stripping all timestamps and other hints?Unfortunately, I don't have the knowledge you do, so it is not that obvious for me :(
btw, I tried feeding with vc1 stream and seekmode=-1, the result is exactly the same as with mkv (I get the black frame whichever one I seek)

salatec
7th October 2009, 19:54
ffvideosource("How.track_4113.mkv")
LimitedSharpenFaster(strength=15)
Spline36Resize(1280,544,1,132,-2,-133)
mkv has one h.264 steam in it with 25fps.
Now x264.exe and avsp sees avs file with 2x more frames and length is 2x longer, but stream is still 25fps. Looking with avsp I see no double frames. How is this possible?

Myrsloik
7th October 2009, 21:46
ffvideosource("How.track_4113.mkv")
LimitedSharpenFaster(strength=15)
Spline36Resize(1280,544,1,132,-2,-133)
mkv has one h.264 steam in it with 25fps.
Now x264.exe and avsp sees avs file with 2x more frames and length is 2x longer, but stream is still 25fps. Looking with avsp I see no double frames. How is this possible?

It's not possible, it violates the fundamental theorem of calculus.

cc1983
13th October 2009, 08:20
i found that ffmpegsource2 audio getframe is much slower than ffmpegsouce1 because it cost much time in finding audio cache. for example, ffmpeg -i test.avi -y out.mp4 benchmark=2000,ffmpeg -i test.avs(ffmpegsource2(test.avi..)) -y out.mp4 benchmark=4000,it is possible to make ffmpegsouce2 find audio cache faster?

Myrsloik
13th October 2009, 17:03
As stated before they are not comparable operations. FFMS2 does not decode all the audio to a raw wave file and then serve that. Use FFIndex/ffmpeg.exe/your favorite application to decode the audio to wav and use wavsource/rawavsource to recreate the old behavior.

vlada
14th October 2009, 06:45
ffvideosource("How.track_4113.mkv")
LimitedSharpenFaster(strength=15)
Spline36Resize(1280,544,1,132,-2,-133)

mkv has one h.264 steam in it with 25fps.
Now x264.exe and avsp sees avs file with 2x more frames and length is 2x longer, but stream is still 25fps. Looking with avsp I see no double frames. How is this possible?

It's not possible, it violates the fundamental theorem of calculus.

In fact, it is possible, if the output is deinterlaced to double framerate.

ACrowley
15th October 2009, 20:23
Ive a question about the VC1 decoder from ffmpeg/ffvideosource.

I made a encode from a M2TS MBluray VC1 source (remuxed to mkv)via ffvideosource.
Works fine and i cant see any Source decoding Problems like Artefacts etc.

Are there any known Bugs or Problems when decoding VC1 ?

Ive a ATI HD4870 so i cant use dgvc1, and WMVideodecoderDMO doesnt work anymore via Directshowsource on Windows7 ,so i was looking for a alternative and i found ffmpeg:)

Very nice work!

LoRd_MuldeR
15th October 2009, 20:31
The output from Microsoft's WMV9/VC1 decoder may be slightly different from ffmpeg's decoder, because Microsoft obviously applies additional post-processing (smoothing) in addition to the Loop Deblock filter.

But I think that's it. And it's not a drawback at all, because this way ffmpeg should actually retain more detail. And you can always add additional post-processing if desired anyway...

Atak_Snajpera
15th October 2009, 21:59
WMVideodecoderDMO doesnt work anymore via Directshowsource on Windows7 ,so i was looking for a alternative and i found ffmpeg

WMVideodecoderDMO does work on Windows 7. You have to do two things. Set ffdshow as preffered DirectShow filter then You have to force ffshow to use wmv9 decoder instead of libavcodec for vc-1. ffmpeg implementation does not have support for interlaced VC-1. Music concerts are often encoded as interlaced.

LoRd_MuldeR
15th October 2009, 22:16
There's a SoC project for adding interlaced-support to ffmpeg's VC-1 decoder:
http://wiki.multimedia.cx/index.php?title=FFmpeg_Summer_Of_Code_2009#VC-1_Interlaced_Support

Found no info on how that project went and if there are any results yet...

saint-francis
16th October 2009, 12:45
But I think that's it. And it's not a drawback at all, because this way ffmpeg should actually retain more detail. And you can always add additional post-processing if desired anyway...

Eh? I consistently get garbled frames when using ffmpegsource on VC-1.

PatlaborForce
16th October 2009, 13:46
There's a SoC project for adding interlaced-support to ffmpeg's VC-1 decoder:
http://wiki.multimedia.cx/index.php?title=FFmpeg_Summer_Of_Code_2009#VC-1_Interlaced_Support

Found no info on how that project went and if there are any results yet...

That was just a proposal. There is nothing there that says that anyone took it up.

LoRd_MuldeR
16th October 2009, 13:49
Eh? I consistently get garbled frames when using ffmpegsource on VC-1.

Then you should provide a sample in order to get it fixed. May be a demuxer problem as well as a decoder problem.

And if your source is interlaced, it currently isn't supported by ffmpeg anyway...

That was just a proposal. There is nothing there that says that anyone took it up.

But there also is no info saying the opposite. However I'd assume the project is still open :o

saint-francis
16th October 2009, 14:37
Then you should provide a sample in order to get it fixed. May be a demuxer problem as well as a decoder problem.

And if your source is interlaced, it currently isn't supported by ffmpeg anyway...


Not interlaced. And I have provided several samples. Should I keep providing them? It seems like about 1/3 of the BD's I get are VC-1 so I have to deal with one every week or so. I've just been using DirectShowSource for most VC-1.

LoRd_MuldeR
16th October 2009, 14:52
Not interlaced. And I have provided several samples. Should I keep providing them? It seems like about 1/3 of the BD's I get are VC-1 so I have to deal with one every week or so. I've just been using DirectShowSource for most VC-1.

If Myrsloik already has gotten your samples, you can only hope and be patient ;)

But if it turns out to be a general FFmpeg problem (not specific to FFmpegSource), then you'd need to complain at the FFmpeg bug tracker:
http://ffmpeg.org/bugreports.html

You can use FFplay to check whether FFmpeg does handle a specific file or not:
http://www.zshare.net/download/666743636a58858b/

PatlaborForce
16th October 2009, 16:11
But there also is no info saying the opposite. However I'd assume the project is still open :o

If it's not listed under here (http://wiki.multimedia.cx/index.php?title=FFmpeg_Summer_Of_Code#2009_Projects) no one took it up as an official SoC project. I guess that doesn't exclude the possibility of some random person somewhere on the internet taking it up.

Blue_MiSfit
28th October 2009, 00:56
Hey guys, quick question regarding ffmsindex.exe

Is it possible to / are there plans to make it possible to multithread this?

I'm getting rather glacial speeds when indexing this feature length 50mbps CBR, 60i hard telecined MPEG-2 4:2:2 source. 30 minutes and ~49% completed :(

<3 ffms2 though!

~MiSfit

thewebchat
28th October 2009, 01:31
Indexing is disk-limited. How would adding more threads help? If anything, it would just make disk thrashing worse.

Suggestion: "Multithread" your hardware by installing a RAID-0 or RAID-1.

Blue_MiSfit
28th October 2009, 01:31
Should be, sure, but I was seeing CPU usage pegged at ~12.5%, which would mean one core is totally saturated on an my 8 core system :(

~MiSfit

TheFluff
28th October 2009, 16:48
Audio indexing requires decoding the audio. Skip that step and it should be purely disk read speed limited. If the decoder isn't multithreaded then ffms2 isn't going to be either. I don't think this would be easy to implement in ffms2 either...

Myrsloik
28th October 2009, 18:12
Theoretically you could split it so each audio track gets its own thread for decoding and one thread for disk reading/parsing. Patches are welcome.

Blue_MiSfit
28th October 2009, 21:14
Loud and clear :devil:

~MiSfit

Myrsloik
28th November 2009, 19:29
THE PROJECT LIVES AGAIN (http://ivtc.org/new/beta/ffms2_general_test.7z)! THE DEATH AND DRAMA OF OTHER PROJECTS ONLY MAKES THIS ONE STRONGER!

Changes so notable even wikipedia will one day be writing about them:

Removed the boost dependency
Fixed the framerate calculation for AVC video in the RFF modes
Improved/fixed the NVOP detection in MPEG4
Fixed an issue where the first 15 audio frames would never be redecoded if needed again
Fixed/added support for uncompressed video and audio formats in matroska, fixes Blank.Clip.720p.x264-darkhold.mkv (Emess)
The indexer and test is now statically linked so no extra runtimes are needed
FFmpeg is now compiled with runtime cpu detection, allows opterons and old cpus to work properly

Test them all or die!

SledgeHammer_999
5th December 2009, 16:28
Link is down! Is this the same build as the one in the google project page(from 18th november)?

LoRd_MuldeR
5th December 2009, 17:02
Link is down! Is this the same build as the one in the google project page(from 18th november)?

Nope, that build seems to date to 2009-11-28. So it must be newer than the 2009-11-18 build on the Google Code site, I assume.

As the link provided by Myrsloik currently seems to be down, I have uploaded the file here:
http://dl.dropbox.com/u/3191920/Beta/FFMS2/ffms2_general_test.2009-11-28.7z

SledgeHammer_999
5th December 2009, 18:50
Thank you very much Lord_mulder.
I think ffms creates wrong timecode files for non-VFR mkv/xvid files. Is there a way to convert a v2 timecode file to v1?(to be easier to read)

Myrsloik
5th December 2009, 22:45
Thank you very much Lord_mulder.
I think ffms creates wrong timecode files for non-VFR mkv/xvid files. Is there a way to convert a v2 timecode file to v1?(to be easier to read)

There is no such thing as a non-vfr mkv. Every frame has a specific time associated with it (usually rounded to ms precision when stored). You also didn't give an example of what the timecodes and what you think they should be in that other post.

(yes, for some unknown reason it seems my website doesn't work right now)

UltraTV
7th December 2009, 19:07
Great tool!

Now, my issue ;-)

Decoding vp6 video in an flv wrapper results in incorrect framerate (24.3902, should be 23.967)

ffmpeg handles the video and audio correctly.

Myrsloik
7th December 2009, 19:49
Great tool!

Now, my issue ;-)

Decoding vp6 video in an flv wrapper results in incorrect framerate (24.3902, should be 23.967)

ffmpeg handles the video and audio correctly.

Try setting rffmode=1 (it's a bit counterintuitive but changes how the framerate is determined).

UltraTV
9th December 2009, 00:38
rffmode=1 results in 1000 fps
2 results in 800 fps...

Myrsloik
9th December 2009, 18:16
Did you try using ffmpeg and mplayer on it to see if either of them gets it right?

UltraTV
9th December 2009, 20:02
videolan handles it correctly, as does a vanilla build of ffmpeg, and mplayer.

Myrsloik
9th December 2009, 21:25
Then I want a sample.

cc1983
14th December 2009, 04:00
why ffmpegsource2 ffindex store AVPackt.dts but not AVPackt.pts?

Myrsloik
14th December 2009, 18:26
It's the most reliable time property according to my own experiments. Pts is just a sorted dts anyway.

le_canz
14th December 2009, 19:54
Hi Myrsloik

I have some problems with AVC streams from my camcorder.

Assume 00005.mts is the file from the cam (Panasonic HDC-TM300 NTSC).

If my script.avs looks like this :


FFIndex("00005.mts")
FFVideoSource("00005.mts")


or this :


FFVideoSource("00005.mts")


Those scripts work and can be opened with virtualdub.

However, the firsts 9 frames are corrupted, but the rest is fine until last frame.

I tried adding FFindex :


FFindex("00005.MTS")

v = FFVideoSource("00005.MTS")
a = FFAudioSource("00005.MTS")

AudioDub(v,a)


But this one spits this error :

http://img710.imageshack.us/img710/5306/errorf.png (http://img710.imageshack.us/i/errorf.png/)

VirtualDub doesn't open anything, but the 00005.MTS.ffindex file is created.
Then, if I try to load the script again, it works as with the first scripts above, except now I have the sound, of course.

If I save the file with VirtualDub, it works fine, with audio, no problem.

Now, If I delete 00005.MTS.ffindex as well as the FFIndex line in the script, I don't have any errors and it works fine...

I tried several times each scripts deleting 00005.MTS.ffindex each times. Note that the firsts frames are always badly decoded.

Out of curiosity, I compared .ffindex files when created by FFIndex() or FFVideoSource() followed by FFAudioSource(), and the two files aren't bit identical.

I use Windows XP x64 (fresh install), and regular Avisynth 2.5.8

I can upload the sample (it's less than 60 Mb) if you want.

Hope this can help you !

vlada
14th December 2009, 21:29
le_canz> I think the problem is, that FFAudioSource is trying to index audio too, but you already have a created (and locked!) index file from the FFVideoSource without audio. The FFAudioSource must be before FFVideoSource in your script. Try to swap the two lines and don't use FFindex. Your script should look like this:
a = FFAudioSource("00005.MTS")
v = FFVideoSource("00005.MTS")

AudioDub(v,a)

Myrsloik
14th December 2009, 21:45
I haven't looked at the sample yet but I can explain the difference between the index files. FFVideoSource doesn't index audio tracks. If you call FFAudioSource after it will only index the required audio track at most and add it. FFIndex on the other hand indexes all tracks by default. Try playing around with IndexMask in FFIndex and see what happens.

le_canz
15th December 2009, 12:18
@ vlada : I forgot to mention that I tried what you suggest, and problems remain. Thanks anyway :)

@ Myrsloik : Thanks for this info. I'll try this and see if it works.

Thanks for your answers !

cc1983
16th December 2009, 06:24
one seek problem:
ffmpegsource2 use av_seek_frame(ctx, video_track, Frame[n].dts, AVSEEK_FLAG_BACKWARD) to search the video position,but the pts from ffmpeg mpegts demuxer is not right.For example:ffmpeg -ss 1184 ..., calculate the position of the time is 1065*****, but pts of the frame is 1083*****,so transfromed by avs the audio has 18s delay.... This is exactly the ffmpeg bug but not ffmpegsourc2.I have not good idea to deal with it.

Myrsloik
16th December 2009, 07:23
That's a known issue. The lavf mpeg ps/ts demuxer is horrible for seeking. That's why I added haali splitter support in the first place.

Is this line of questioning going somewhere particular?

cc1983
17th December 2009, 12:38
most dvd video use mpeg ts demuxer.
i found that:
1.the pts of frame not right because some Frames's RepeatPict == 1, and Frame[i+1]-Frame[i] is larger than others, i have to recalculater the pts
2.some VFR(variable frame rate) file,Frame[i+1]-Frame[i] is not the same.
both of them can cause files AV sync problem transformed by avs used trim(pos1, pos2).

Myrsloik
17th December 2009, 17:40
You are getting exactly what you're asking for. The pts values as they are. No more, no less. Process them all you want if you don't like them but don't blame me. The seeking stuff is LISTED UNDER KNOWN ISSUES AND LIMITATIONS. What else do you want from me?

Also, WHY DO YOU THINK VFR WILL BE PRESERVED CORRECTLY IF YOU START FILTERING IN AVISYNTH WHICH ONLY SUPPORTS CFR?

The problems are most likely only in your mind.

cc1983
18th December 2009, 08:47
sorry, i only want to discuss question but not to blame you, i don't know AVISYNTH ONLY SUPPORTS CFR, may be the pts of the file which has RepeatPict is wrong.

cc1983
18th December 2009, 09:02
and by the way, you are my super star.

le_canz
19th December 2009, 11:58
I tried different values for IndexMask with FFIndex, and you were right Myrsloik :)

I get the error with -1 (and 2 of course as my file only have one audio stream), while 0 and 1 work fine.

I guess the default value is -1 ?

Any idea about the problems decoding firsts frames ?

Thank you for this great plugin !

Edit : yeah default is -1, how dumb I am :-p

Myrsloik
19th December 2009, 21:54
I tried different values for IndexMask with FFIndex, and you were right Myrsloik :)

I get the error with -1 (and 2 of course as my file only have one audio stream), while 0 and 1 work fine.

I guess the default value is -1 ?

Any idea about the problems decoding firsts frames ?

Thank you for this great plugin !

Edit : yeah default is -1, how dumb I am :-p

Your clip actually works for me. Did you install the n.2 (or newer) test version of haali's splitter? If not you should try that and then delete the index file.

Myrsloik
19th December 2009, 23:39
New test version:
http://ivtc.org/ffms_test.7z

Changes since the last test version:
Fixed h264 in mkv which was remuxed from bd sources, there are no longer decoding artifacts after seeking
Use pts instead of dts for seekinf with lavf
Now compresses the index files with zlib to save space

All changes since 2.12:
Removed the boost dependency
Fixed the framerate calculation for AVC video in the RFF modes
Improved/fixed the NVOP detection in MPEG4
Fixed an issue where the first 15 audio frames would never be redecoded if needed again
Fixed/added support for uncompressed video and audio formats in matroska, fixes Blank.Clip.720p.x264-darkhold.mkv (Emess)
The indexer and test is now statically linked so no extra runtimes are needed
FFmpeg is now compiled with runtime cpu detection, allows opterons and old cpus to work properly

le_canz
20th December 2009, 10:23
Your clip actually works for me. Did you install the n.2 (or newer) test version of haali's splitter? If not you should try that and then delete the index file.

I didn't. But I tried to remux my streams ni mp4 container using mp4box, and then everything is fine.

LoRd_MuldeR
22nd December 2009, 00:46
I can't open my Xvid AVI file with the 2009-12-19 release, FFVideoSource fails with "Video stream unseekable". As soon as I go back to the 2009-11-28 release it works again.

Please tell me if you need a sample file...

Myrsloik
22nd December 2009, 01:02
No samples or reports needed bugs in the test version. I've found a whole serious pile already. When I've fixed some more I'll put up another one...

LoRd_MuldeR
22nd December 2009, 01:03
No samples or reports needed bugs in the test version. I've found a whole serious pile already. When I've fixed some more I'll put up another one...

:thanks:

markanini
22nd December 2009, 15:50
a request: Include spp and it's variations.

Myrsloik
27th December 2009, 21:41
a request: Include spp and it's variations.

SPP is a completely separate filter which is not a part of ffmpeg. How does it even fit in here?

markanini
27th December 2009, 22:27
Since regular pp is available within FFmpegSource and spp is available in ffdshow I figured it wouldn't be to far off to request spp. It seems like a good filter to play with for low quality sources.

Zverik
28th December 2009, 18:28
Myrsloik, thanks for your plugin!
It opened 22GB mp4 which DSS and ffdshow failed to open.

Atak_Snajpera
13th January 2010, 22:54
FFVideoSource can not return correct number of frames from interlaced .MTS files.
FFVideoSource returns number of fields instead of number of real frames. FFVideoSource automatically multiplies number of real frames by 2 which is incorrect! I don't know if you know that camcorders flag everything as interlaced even in progressive mode! So AviSynth thinks that source has two times more frames. Result is crash in every app (MPC, FFmpeg)

Emess
15th January 2010, 09:11
Diregard

LoRd_MuldeR
15th January 2010, 18:46
Any chance for a fresh build? Looks like r257 had a lot of fixes.

Myrsloik
15th January 2010, 20:18
http://ivtc.org/ffms_test_r257.7z

LoRd_MuldeR
15th January 2010, 20:57
http://ivtc.org/ffms_test_r257.7z

:thanks:

Atak_Snajpera
15th January 2010, 23:10
http://ivtc.org/ffms_test_r257.7z
new version at least does not crash with .mts files but it still incorrectly counts frames!
Test file http://www.aktiv-verlag.com/~webvideos/testvideos/2009/panasonic/VIDEO_Panasonic_TM350.MTS

This file according to DirectShowSource() has 1173 frames (DGAVCDec sees 1174) FFVideoSource still sees 1174*2 (number of fields !?!?!)
Also It would be nice if ffmpeg-mt decoder was used for h.264 files by default.

Leak
15th January 2010, 23:22
FFMS2 is multiplatform while ffdshow is for windows only. It doesn't make sense to include a windows only function in a multiplatform application, unless you intend to code it yourself?
Since when is SPP deblocking windows only when it's taken from mplayer? :confused:

np: Underworld - Dirty Epic (DubNoBassWithMyHeadMan)

stax76
16th January 2010, 05:22
There is a critical issue with a m2ts avc sample recently posted in the RipBot264 thread, allocates memory like mad. After muxing to mkv using eac3to the issue is gone.

http://forum.doom9.org/showthread.php?p=1364299#post1364299


General
ID : 0
Complete name : D:\Unsortiert\last emperor_0.m2ts
Format : BDAV
Format/Info : Blu-ray Video
File size : 50.0 MiB
Duration : 33s 366ms
Overall bit rate : 12.6 Mbps
Maximum Overall bit rate : 48.0 Mbps

Video
ID : 4113 (0x1011)
Menu ID : 1 (0x1)
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4.1
Format settings, CABAC : Yes
Format settings, ReFrames : 4 frames
Duration : 33s 366ms
Bit rate : 10.6 Mbps
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate : 23.976 fps
Resolution : 24 bits
Colorimetry : 4:2:0
Scan type : Progressive
Bits/(Pixel*Frame) : 0.212
Stream size : 42.0 MiB (84%)

moviefan
19th January 2010, 19:12
There seem to be issues with VC1 in (at least) mkv. I sometimes get ugly blocks (the frame is totally destroyed) when I seek in VirtualDub. Also, when I go forward and backward a few frames, I sometimes get black frames when going backwards again although they are actually not black. When I reload the video and seek to this frame, it is normal again.

Myrsloik
19th January 2010, 20:57
I still like clips and version numbers but cookies are fine too.

moviefan
19th January 2010, 21:09
Clip: Anything encoded with VC1 that I have come across... Version: latest build from ivtc.org which is r257.

moviefan
21st January 2010, 21:10
http://ffmpeg.arrozcru.org/autobuilds/blog/2010/01/20/dxva2/ DXVA has been added to ffmpeg. Is there a way to use this in FFMS2 to decode DXVA compatible sources with DXVA in Avisynth to speed up the encoding process?

LoRd_MuldeR
21st January 2010, 21:16
Not it can't. DXVA is a playback technology. The compressed data is sent to the DXVA renderer and from there it will be sent directly to the screen.

You cannot get the decompressed data back with DXVA in a way similar to the CUDA Video API. Therefore DXVA isn't suitable for an Avisynth source!

moviefan
21st January 2010, 21:19
Hm, but why has it been intergrated into the ffmpeg project? Isn't ffmpeg an encoder tool using e.g. x264 and many more? So I thought DXVA is intended for decoding in the encoding process...

LoRd_MuldeR
21st January 2010, 21:23
DXVA support has been added to libavcodec, which is one part of the FFmpeg project. Many applications use libavcodec for playback.

Just think about DXVA enabled playback in MPlayer and VLC ;)

moviefan
21st January 2010, 21:25
OK, it's ashame, that GPU decoding for processing video content is still impossible to get (if you have an ATI card).

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

me7
26th January 2010, 00:46
I have a slightly off-topic request: can someone help me compile the svn build?
I study computer science and I'm fluent in .Net/C# and Java, so I do know what source code and compiler are. It's just that my university does everything in Java and I still need to get into some C++ myself on my spare time.
If I had time, I'd look around for a compatible compiler/IDE myself and toy with it until it works, but I have still three more exams to study for this week and I'd like to get some encoding done in the background.

If someone is willing to give me some hints for this strange request I'd be very greatful.

TheFluff
26th January 2010, 01:16
There's a brief guide in the api docs, but it's sorta out of date because I'm lazy.

I assume you want to build for Windows. You will need mingw and Microsoft Visual C++ 2008; the free express edition of visual studio works if you build without HAALISOURCE, if you want to enable that you either need to find a better version or hunt down the appropriate ATL headers/libs.

1) Compile zlib (trivial) and ffmpeg in mingw (there should be plenty of guides on how to do this). Required configure flags are --enable-gpl --enable-postproc --enable-memalign-hack; suggested flags are --disable-devices --disable-hwaccels --disable-encoders --disable-muxers --disable-filters --disable-network --disable-debug. Also add --enable-runtime-cpudetect if you plan on redistributing your compile.
2) Add your mingw/include and mingw/lib folders to MSVS's include/lib paths.
3) Find stdint.h and inttypes.h for MSVC somewhere (google) and put them somewhere where MSVC can find them; that location must be higher up in the visual studio paths setting than the mingw include folder or it'll try to use the gcc versions and go bork.
4) Open the project file in build-msvc. If you're using the express edition of visual studio you need to remove the HAALISOURCE define from ffms2 -> project property pages -> c/c++ -> preprocessor (or google up some ATL libs instead).
5) Hit build.
6) ???
7) compilation errors etc

Blue_MiSfit
26th January 2010, 02:16
Hi guys,

I've got an ugly little bug with FFMS2 (I think it's actually a bug with libavcodec) MJPG decoding.

I have an MOV source (many actually) with MJPG, and it is in fact standard TV range. Both ffms2 and ffdshow (when I remux to AVI) decode this as scaled to PC range, without doing any interpolation. They simply stretch out the range, leaving gaps in the histogram (!)

QTInput handles this decoding correctly.

I realize this likely isn't an issue with FFMS2 per-se, but it seems like there's a lot of backporting of lavc fixes going on :)

Ideas? I can provide samples if needed.

Images:
QTInput:
http://imgur.com/9wwSk.jpg

FFMS2:
http://imgur.com/VT74Z.jpg

~MiSfit

Jeremy Duncan
26th January 2010, 02:59
I have a slightly off-topic request: can someone help me compile the svn build?
I study computer science and I'm fluent in .Net/C# and Java, so I do know what source code and compiler are. It's just that my university does everything in Java and I still need to get into some C++ myself on my spare time.
If I had time, I'd look around for a compatible compiler/IDE myself and toy with it until it works, but I have still three more exams to study for this week and I'd like to get some encoding done in the background.

If someone is willing to give me some hints for this strange request I'd be very greatful.

http://ffdshow-tryout.sourceforge.net/wiki/devel:building

moviefan
27th January 2010, 12:32
Can anyone help me compile FFMS2? I can compile ffmsindex.exe and ffmpeg.exe but I also want the avisynth .dll file. How can I get that? I use msys and GCC 3.4.5 and have all needed packages for the GCC. However I don't get the avisynth .dll file for some reason.

Myrsloik
27th January 2010, 14:59
You have to use msvc to compile the avisynth dll. If you only use gcc then you can only compile the library parts but not the avisynth plugin.

Btw, gcc 3.4.5 guarantees a broken ffmpeg compile so it's time to upgrade to the 4.3 or 4.4 series.

me7
27th January 2010, 15:33
My compile just passed a test-encode.
Thanks TheFluff and Jeremy Duncan.

me7
27th January 2010, 18:10
You have to use msvc to compile the avisynth dll. If you only use gcc then you can only compile the library parts but not the avisynth plugin.

Btw, gcc 3.4.5 guarantees a broken ffmpeg compile so it's time to upgrade to the 4.3 or 4.4 series.

Great, so my build is currupt after all.
I downloaded the latest MinGW but it came with gcc 3.4.5. How do I update it to 4.3 or 4.4? And which of the two is "better" for FFmpegSource?

IanB
27th January 2010, 22:12
3.4.3 or 3.4.4 (previous versions ;) )

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

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

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

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

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

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

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

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

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

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

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

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


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

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

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

D.)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

MuLTiTaSK
29th January 2010, 22:40
@Abradoks

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

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

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

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

Did you build this one your Abradoks?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Then I do a Build->Build ffms2.

I get these errors:

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

The contents of BuildLog.htm are

Build Log


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

Command Lines


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

call ./msvc_autoconf.bat

if errorlevel 1 goto VCReportError

goto VCEnd

:VCReportError

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

exit 1

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

Output Window


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

Results


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


What am I missing?

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

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

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

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

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

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

What do they mean?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Correct, I'm only using it with Aegisub.

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

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

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

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

I keep getting "could not connect to server".

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

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

It's working now. Thanks.

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

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

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

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

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

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

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

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

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

video = FFVideoSource("video.mkv")

audio = FFAudioSource("video.mkv")

AudioDub(video, audio)

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

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

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

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

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

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

Changelog:
2.13

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


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

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

The API docs have been updated as well.

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

Do I miss something ???

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

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

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

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

Do this routine use FFMS_MakeIndex or FFMS_DoIndexing?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

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


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

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

Thanks a bunch for the help.

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

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

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

"FFAudioSource: Audio track contains no audio frames"

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

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

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

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

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

~MiSfit

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

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

~MiSfit

There are in some rare cases bugs only in ffmpeg-mt (very rare, actually) but the biggest reason is that you need to link it to pthreads and that's just no fun on windows. So get compiling and contribute a build. There are no known issues with it.

Blue_MiSfit
22nd February 2010, 18:58
Indeed. I should get things up and running, but compiling software is one of my least favorite activities, especially using cygwin etc.... :(

If I get adventurous I might give it a whirl...

~MiSfit

TheRyuu
24th February 2010, 19:14
Indeed. I should get things up and running, but compiling software is one of my least favorite activities, especially using cygwin etc.... :(

If I get adventurous I might give it a whirl...

~MiSfit

I'm still alive. I'll have a build soon.

Pthread linking has become easy on windows now thanks to Ramiro with his auto-initialization (http://www.speedyshare.com/files/21117693/pthreads-autostatic-msc_and_gcc-mingw32-2.tar.bz2). Furthermore, because of this we can now remove unreferenced data in msvc as well (save <0.5MB yay!).
I guess I can commit that simple build change since the only reason that was put in was because of the pthreads stuff on windows.

kemuri-_9
24th February 2010, 23:52
I'm still alive. I'll have a build soon.

Pthread linking has become easy on windows now thanks to Ramiro with his auto-initialization (http://www.speedyshare.com/files/21117693/pthreads-autostatic-msc_and_gcc-mingw32-2.tar.bz2). Furthermore, because of this we can now remove unreferenced data in msvc as well (save <0.5MB yay!).
I guess I can commit that simple build change since the only reason that was put in was because of the pthreads stuff on windows.

ramiro's patch is only specifically for mingw builds of pthread that stay within the realm of mingw...
from conversations about this with a few people,
this patch uses specialized gcc function attributes that fail to work properly when msvc gets involved into the situation.

TheRyuu
25th February 2010, 04:18
ramiro's patch is only specifically for mingw builds of pthread that stay within the realm of mingw...
from conversations about this with a few people,
this patch uses specialized gcc function attributes that fail to work properly when msvc gets involved into the situation.

And following a month long back and fourth e-mail conversation he fixed the msvc part :) (tested it and it works).

kemuri-_9
25th February 2010, 14:02
And following a month long back and fourth e-mail conversation he fixed the msvc part :) (tested it and it works).

i don't recall ever seeing a new patch for this, where is it at?

TheRyuu
25th February 2010, 20:43
i don't recall ever seeing a new patch for this, where is it at?

Here you go. (http://paste2.org/p/688870)

Guess it never left my inbox. :p
Patch is off of pthreads svn for the date in there.

As far as (stupid) license stuff is concerned, perhaps I should make a note of it, AFAIK, it has some LGPL code from libavutil/log.c and the rest is GPL'd I think.

TheRyuu
25th February 2010, 21:43
ffms2-r292.7z (http://ffmpegsource.googlecode.com/files/ffms2-r292.7z)

Includes both vanilla ffmpeg and ffmpeg-mt, both patched with windows utf patch (and NOT the pthreads patch!)

Has the auto-initialization pthreads so give it a try. :)
Probably only going to notice the threading on the ffmpeg-mt build but both are built with pthreads (and both should work!).

Atak_Snajpera
26th February 2010, 16:29
MT version crashes
http://img46.imageshack.us/img46/4051/new1q.png

source is interlaced 50i (Canon hf200)

Script
video=FFVideoSource("C:\pal.m2ts",cachefile="C:\temp\index.ffindex")
return video


normal version works ok.

TheRyuu
26th February 2010, 20:49
normal version works ok.

The normal version in the r292 package? or normal as in v2.13?
Sample?

Atak_Snajpera
26th February 2010, 22:17
The normal version in the r292 package?
Yes. Your single threaded version. Only MT crashes immediately at the beginning

sample http://www.mediafire.com/file/z3qydwkn0it/pal.m2ts

TheRyuu
28th February 2010, 06:33
Yes. Your single threaded version. Only MT crashes immediately at the beginning

sample http://www.mediafire.com/file/z3qydwkn0it/pal.m2ts

Well I'm pretty sure it's not related to the auto-initialization pthreads, the old method pthreads also crashes.

May be a problem in ffmpeg-mt, works with threads=1.

Mr VacBob
28th February 2010, 06:38
Do you have a backtrace?

rack04
2nd March 2010, 22:51
I'm still alive. I'll have a build soon.

Pthread linking has become easy on windows now thanks to Ramiro with his auto-initialization (http://www.speedyshare.com/files/21117693/pthreads-autostatic-msc_and_gcc-mingw32-2.tar.bz2). Furthermore, because of this we can now remove unreferenced data in msvc as well (save <0.5MB yay!).
I guess I can commit that simple build change since the only reason that was put in was because of the pthreads stuff on windows.

Can pthreads be statically linked to 64-bit ffmpeg with mingw32?

TheRyuu
16th March 2010, 01:28
Can pthreads be statically linked to 64-bit ffmpeg with mingw32?

I think you'd have to build pthreads with that patch on mingw64 and then build ffmpeg on mingw64 as well linked against that 64bit build of pthreads.

TheFluff
27th March 2010, 23:04
@TheFluff, about this bug:



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

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

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

I think I may have fixed this, try this build: http://www.mod16.org/ffms2/ffms2-r309.7z
(probably forgot UTF8 support left on, so don't try to open any files with funny names with it)

I didn't actually test your stuff by the way; dark shikari was yelling at me about some segfault some of his gsoc students were having and I realized this bug was most likely related to that.

jmartinr
28th March 2010, 15:37
I think I may have fixed this, try this build: http://www.mod16.org/ffms2/ffms2-r309.7z
(probably forgot UTF8 support left on, so don't try to open any files with funny names with it).
Thanks, will test tomorrow.

jmartinr
29th March 2010, 14:18
I didn't actually test your stuff by the way; dark shikari was yelling at me about some segfault some of his gsoc students were having and I realized this bug was most likely related to that.

Tested 8 small encodes without problems, so it seems OK now. :thanks:

rack04
21st April 2010, 18:32
Is it possible to cross compile ffmpegsource using MinGW in MSYS environment under WIN32? I have no problems cross compiling ffmpegsource under WIN64 but I get the following error in WIN32:

configure:3347: error: in `/c/x264/ffmpegsource-src':
configure:3351: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.


Here are the commands that I use to cross compile ffmpegsource:

./configure --prefix=/c/ffms2/x86_64-pc-mingw32 --build=x86_64-pc-mingw32 --host=x86_64-pc-mingw32

kemuri-_9
21st April 2010, 23:40
try specifying only --host=x86_64-pc-mingw32 instead of both --host and --build.

Great Dragon
26th April 2010, 16:56
What is output colorimetry by default? BT.709 or BT.601?

Great Dragon
26th April 2010, 17:34
Stephen R. Savage, sorry my bad. So, FFMPEG uses BT.601 for convert and HD video colors isn't correct, right? What I need to add to script to see colors like in DGIndexNV or MPC Home-Cinema in HD?

kemuri-_9
27th April 2010, 00:19
RGB/YUV conversions can occur, but that's source and user dependent, e.g.

- user selects to output RGB from a YV24 source
- user selects to output YV12 from a RGB32 source

when this occurs it uses the libswscale default,
which seems to be Rec./BT.601

Groucho2004
30th April 2010, 22:07
I just noticed that the content of the index file created by ffmsindex.exe is completely different to the index file that gets created automatically when I just run an Avisynth script with FFVideosource.

Can one of the developers shed some light on this?

I'm using ffms2 r292 from http://code.google.com/p/ffmpegsource

Edit:
However, the generated files (AVS -> uncompressed AVI) are bit-identical.

Myrsloik
1st May 2010, 12:11
Did you make sure to index the same tracks?

Groucho2004
1st May 2010, 13:53
Did you make sure to index the same tracks?

Yes I did. I have uploaded a sample and the 2 resulting index files here:
http://www.iol.ie/~schubert/Test.zip

"test_dll.m2v.ffindex" is the index file generated with the simple Avisynth script.
"test_ffmsindex.m2v.ffindex" is the index file generated with ffmsindex.exe.

Myrsloik
1st May 2010, 18:59
Can you explain why this is an issue? It sounds like everything works to me.

Groucho2004
1st May 2010, 21:52
Can you explain why this is an issue? It sounds like everything works to me.

It's not an issue. I was just curious why the index files are so different since I assumed that ffmsindex.exe uses the same functions in ffms2.dll.

asarian
31st May 2010, 23:44
I would like to use FFVideoSource to solve the following (still unsolved) problem of non-frame accurate encoding:

http://forum.doom9.org/showthread.php?t=147616

I tried things like:

FFVideoSource("D:\Temp\job1\video.mkv").ConvertToYV12().TemporalDegrain(degrain=3, ov=4, blksize=16)

But I keep getting this error:

avis [error]: unsupported input format (DIB )

The mkv is made with the latest mkvmerge, and contains just one simple 1080p elementary VC1 stream. And is being properly set to the ConvertToYV12() color space. It simply should work. But it doesn't.

I'm really still looking for a way to do a hefty (slow) TemporalDegrain, without frames getting out of sequence or being skipped. There's gotta be other people who do TemporalDegrain stuff and who get a clean encoding. I don't care if it takes 3x as long, as long as frames stay in sequence.

Thanks.

kemuri-_9
1st June 2010, 00:23
avis [error]: unsupported input format (DIB )

this particular error is that you're trying to give x264 RGB video which is unsupported in the old VFW interface.
this error is also caused when there is a script error as avisynth creates a RGB video with the error message overlayed onto it when used through VFW.

these issues are only generated by x264 builds that are still using VFW to interact with avisynth which has not been the way x264 does it for some time now. you should update your build and try again.
from the looks of your script, looks like you have an error in the script somewhere and so using a recent x264 build will tell you what the error is...
virtualdub could also tell you what the error is.

asarian
1st June 2010, 13:55
this particular error is that you're trying to give x264 RGB video which is unsupported in the old VFW interface.
this error is also caused when there is a script error as avisynth creates a RGB video with the error message overlayed onto it when used through VFW.

these issues are only generated by x264 builds that are still using VFW to interact with avisynth which has not been the way x264 does it for some time now. you should update your build and try again.
from the looks of your script, looks like you have an error in the script somewhere and so using a recent x264 build will tell you what the error is...
virtualdub could also tell you what the error is.

Thanks, Kemuri! This was precisely the sort of answer I was looking for. :)

Usually I work from a "Don't fix it if it ain't broken." adage, but in this case I guess the old x264 (1093) really needed updating after all.

Seems CoreAVC is borked with the new ffdshow and/or new Haali media splitter (odd artifacts, occasionally garbled output); but fortunately ffdshow itself handles the H264 decoding just fine. I'll let you know what the results are on the updated install.

asarian
2nd June 2010, 17:50
Kemuri-san, doumo arigatou gozaimashita! :)

Yep, it's solved now. Temporal degraining is not exactly fast (0.82 fps on a VM core duo), but the output using FFVideoSource is perfectly frame consistent and no more skipping and jittery stuff.

Blue_MiSfit
26th June 2010, 05:22
Hi guys!

I'm seeing REALLY slow indexing speeds for my 80mbps intra-only 1080p MPEG-2 mezzanine files. Specifically, on the order of ~8-10MB per second. At this rate, indexing your average 2 hour feature basically runs real-time AT BEST.

I thought ffmsindex.exe was supposed to usually be I/O bound.

Here's a sample MediaInfo dump from one of these mezzanine files. Anything stand out as an obvious PITA?



General
Complete name : RussiansAreComing_80mbps_NTSC_235HD.mpg
Format : MPEG-PS
File size : 71.4 GiB
Duration : 2h 5mn
Overall bit rate : 81.3 Mbps

Video
ID : 224 (0xE0)
Format : MPEG Video
Format version : Version 2
Format profile : High@High
Format settings, BVOP : No
Format settings, Matrix : Default
Format settings, GOP : N=1
Duration : 2h 5mn
Bit rate mode : Constant
Bit rate : 80.0 Mbps
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate : 23.976 fps
Color space : YUV
Chroma subsampling : 4:2:2
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 1.609
Stream size : 69.6 GiB (98%)

Audio
ID : 192 (0xC0)
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 2
Duration : 2h 5mn
Bit rate mode : Constant
Bit rate : 384 Kbps
Channel(s) : 2 channels
Sampling rate : 48.0 KHz
Stream size : 345 MiB (0%)


Here's another offender, this time a TS at 50mbps, with AES3 PCM audio, and hard telecine :devil:!!!


General
ID : 0
Complete name : OxfordMurders_60i_50mbps_NTSC_235HD.mpg
Format : MPEG-TS
File size : 43.3 GiB
Duration : 1h 48mn
Overall bit rate : 57.1 Mbps

Video
ID : 481 (0x1E1)
Menu ID : 1 (0x1)
Format : MPEG Video
Format version : Version 2
Format profile : High@High
Format settings, BVOP : No
Format settings, Matrix : Default
Format settings, GOP : N=1
Duration : 1h 48mn
Bit rate mode : Constant
Bit rate : 50.0 Mbps
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate : 29.970 fps
Color space : YUV
Chroma subsampling : 4:2:2
Bit depth : 8 bits
Scan type : Interlaced
Scan order : Top Field First
Bits/(Pixel*Frame) : 0.805
Stream size : 36.7 GiB (85%)

Audio
ID : 482 (0x1E2)
Menu ID : 1 (0x1)
Format : PCM
Format profile : AES3
Duration : 1h 48mn
Bit rate : 5 760 Kbps
Channel(s) : 6 channels
Channel positions : Front: L C R, Side: L R, LFE
Sampling rate : 48.0 KHz
Bit depth : 16 bits
Stream size : 4.36 GiB (10%)


Any thoughts? DGIndex seems to blow ffmsindex.exe out of the water in these cases! I'm so confused as to why :(

Thanks folks,
Derek

PS - DGIndex can't extract the AES3 audio from files like these into a WAV. For this, I have to use eac3to, which does it flawlessly - and gives me free AC3 encoding while I'm at it! Of course, this means I have to basically read the entire file TWICE, before I can even start encoding it. This makes me a saaaad panda :(

dansrfe
26th June 2010, 07:40
Doesn't dss2 work best? Just wondering. Also, I must say that I am very impressed with those files. Love those bitrates but I think I'm already starting to get nightmares of the sizes lol.

Blue_MiSfit
26th June 2010, 08:21
Baaah those sizes are tiny :) ProRes HQ is ~220mbps for the same frame size and rate!!

I'm working on getting every setting dialed in for x264 capture instead of MPEG-2. At 50-80mbps (ok CRF so it's gonna vary a lot) it should be close to ProRes quality.

DSS2 does decode the fastest, but unfortunately (with the muxes I get anyway) it consistently returns a different number of frames than DGIndex. It's usually ~5 frames off, which can obviously lead to a substantial audio desync!

Regardless, my indexing issue is pretty nasty. Any thoughts on why FFMSIndex can't run these files through at closer to I/O bound speeds? This was on a fresh 2TB, 7200rpm hard drive with almost nothing else, so it wasn't a storage issue...

Thanks,

Derek

SledgeHammer_999
29th June 2010, 22:24
A programming question. I am not sure if this is the correct place.

Is there any way to use the FFMS API and get the SAME (fake)framerate that ffms reports to avisynth? If yes, please point me to the correct function, since a quick reading of the docs didn't yield a definitive answer. Thank you.

Groucho2004
29th June 2010, 23:21
Any thoughts on why FFMSIndex can't run these files through at closer to I/O bound speeds?

The problem might be the introduction of compressed index files a few months ago. I seem to remember that the indexing was faster before. I never had a problem with the size of the index files, even uncompressed.

kemuri-_9
29th June 2010, 23:22
A programming question. I am not sure if this is the correct place.

Is there any way to use the FFMS API and get the SAME (fake)framerate that ffms reports to avisynth? If yes, please point me to the correct function, since a quick reading of the docs didn't yield a definitive answer. Thank you.

the framerate is corrected to NTSC rationals for any and all sources that are opened through the API.
looking at FFMS_VideoProperties from a FFMS_VideoSource will have the corrected FPSNumerator and FPSDenominator values - the same ones that avisynth gets.

nothing usually cares about this correction except avisynth since it is cfr and can't use the vfr timebase & timestamps.

SledgeHammer_999
29th June 2010, 23:28
Thank you. The corrected framerate is useful when you want to "transform" the sub timings through aegisub. (when opening a vfr vid and hardsubbing through avisynth).

SledgeHammer_999
8th July 2010, 01:46
I have a question about the indexing. Shouldn't the ffindex file be the same regardless of under which OS it was created?

I compiled svn-ffms2 + git-ffmpeg-mt under Ubuntu 64bit and used ffmsindex to index a file. Then I booted in Windows XP (32bit) and compiled the same sources. I created a simple avs file using FFVideoSource(). But when I open the avs in mpc the ffindex gets recreated instead of using the one I created earlier. Is this normal? Can I avoid it? (I want to batch index(among other things) my files under linux and then switch to windows for the encoding part).

kemuri-_9
8th July 2010, 03:39
I have a question about the indexing. Shouldn't the ffindex file be the same regardless of under which OS it was created?

I compiled svn-ffms2 + git-ffmpeg-mt under Ubuntu 64bit and used ffmsindex to index a file. Then I booted in Windows XP (32bit) and compiled the same sources. I created a simple avs file using FFVideoSource(). But when I open the avs in mpc the ffindex gets recreated instead of using the one I created earlier. Is this normal? Can I avoid it? (I want to batch index(among other things) my files under linux and then switch to windows for the encoding part).

since you're using the same source of ffms2/ffmpeg, that excludes the possibility of incompatible versions.

but i see some use of size_t in the the index file data, so it appears index files from 64bit and 32bit platforms are quite possibly incompatible with each other.
see if you can replicate the re-indexing on your windows system if you use a 32bit version of ffmsindex on your ubuntu one.

TheFluff
8th July 2010, 19:56
I have a question about the indexing. Shouldn't the ffindex file be the same regardless of under which OS it was created?

I compiled svn-ffms2 + git-ffmpeg-mt under Ubuntu 64bit and used ffmsindex to index a file. Then I booted in Windows XP (32bit) and compiled the same sources. I created a simple avs file using FFVideoSource(). But when I open the avs in mpc the ffindex gets recreated instead of using the one I created earlier. Is this normal? Can I avoid it? (I want to batch index(among other things) my files under linux and then switch to windows for the encoding part).

The indexing "file format" is basically constructed by fwriting various internal data structures to disk, so it's extremely unportable not only between different operating systems, but also between different compilers, different compiler versions and other stuff. There is really no guarantee a given index file will work with any other binary except the one that you created it with. Someone should really fix that one of these days...

SledgeHammer_999
8th July 2010, 20:35
The indexing "file format" is basically constructed by fwriting various internal data structures to disk, so it's extremely unportable not only between different operating systems, but also between different compilers, different compiler versions and other stuff. There is really no guarantee a given index file will work with any other binary except the one that you created it with. Someone should really fix that one of these days...

That explains a lot...

I compiled a 32-bit version of ffms2 in Ubuntu and used it under the 64-bit. Same results as previously.

I will create a bug report upstream so someone may fix this.

Snowknight26
9th July 2010, 23:15
Is there any way to get dubugging output during normal usage? I'm battling ffms2 crashing in one of my avisynth scripts but it's hard to do with no info other than Windows saying ffms2.dll is the culprit.

LoRd_MuldeR
9th July 2010, 23:52
Is there any way to get dubugging output during normal usage? I'm battling ffms2 crashing in one of my avisynth scripts but it's hard to do with no info other than Windows saying ffms2.dll is the culprit.

Did you try using a debugger?

(The output from a debugger may be of limited use when using a non-debug build though)

kemuri-_9
10th July 2010, 00:12
Is there any way to get dubugging output during normal usage? I'm battling ffms2 crashing in one of my avisynth scripts but it's hard to do with no info other than Windows saying ffms2.dll is the culprit.

There is FFSetLogLevel(int level) for use in avs scripts...
but the normal 'release' builds of ffms2 don't properly set the logging callback from the standard one so you won't see any messages, you'll need to get a debug version that outputs messages to DebugView (http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx)

the logging feature is naturally ffmpeg's so the log levels are as follows:

#define AV_LOG_QUIET -8
#define AV_LOG_PANIC 0
#define AV_LOG_FATAL 8
#define AV_LOG_ERROR 16
#define AV_LOG_WARNING 24
#define AV_LOG_INFO 32
#define AV_LOG_VERBOSE 40
#define AV_LOG_DEBUG 48

Snowknight26
10th July 2010, 00:17
Thanks for the info kemuri-_9. Now to find a debug build.

Snowknight26
10th July 2010, 22:59
Seems like there's memory leak in ffms2.dll. Tried debugging it but all VS showed me for the call stack was
> ffms2.dll!_ff_mpeg4_find_frame_end() + 0x1408 bytes
ffms2.dll!_ff_mpeg4_find_frame_end() + 0x1621 bytes
002cee18()

I still have it paused in the debugger so if there's anything else I can provide, by all means..

As far as I can tell, it doesn't like the M2TS source in my avs (http://pastebin.com/KcFrV9h3).

kemuri-_9
10th July 2010, 23:07
ff_mpeg4_find_frame_end is a ffmpeg function.
to my knowledge ffmpeg is known to have issues with ts/m2ts

Blue_MiSfit
14th July 2010, 21:12
@kemuri-_9:

Any thoughts on slllooooowww indexing performance?

Derek

Myrsloik
14th July 2010, 23:08
@kemuri-_9:

Any thoughts on slllooooowww indexing performance?

Derek

Did you try only indexing audio/only indexing video to see if it is caused by only one of them?

Overall I think a bit of threading really wouldn't hurt in the indexing since it's completely single threaded and having many audio tracks can slow it down quite a bit.

Blue_MiSfit
15th July 2010, 05:53
Hi Myrsloik,

I will do that. Almost all of my samples contain only a single audio track - either a stereo MP2 or a 2ch or 5.1ch AC3. No fancy pants stuff ;)

Threading would be much appreciated :D

Derek

TheRyuu
16th July 2010, 07:48
ffms2-mt-r318.7z (http://ffmpegsource.googlecode.com/files/ffms2-mt-r318.7z)

Can probably be considered just a little less experimental now (in regards to the auto-initializing pthreads). :)

Included the ffmpeg-mt libs and some other stuff (opencore) all of which is probably useless (can be used to build x264 with ffmpeg support, suppose that's good if you can't build ffmpeg for whatever reason).

Wojszwillo
12th August 2010, 12:19
I have this error message, when try to open avs file in VirtualDub: "FFVideoSource: Can't create decompressor: Unsuported Compression method". Problem, i think is in mkv file, that has been created with mkvmerge 4.2.0. (nevest one). Index file is'nt created nor in automated script mode, nor with ffmsindex.exe (error message - the same - "Indexing error: Can't create decompressor: Unsuported Compression method"). With files, made by older mkvmerge versions, ffms2 works fine.
What You think about that?

kemuri-_9
12th August 2010, 13:19
I have this error message, when try to open avs file in VirtualDub: "FFVideoSource: Can't create decompressor: Unsuported Compression method". Problem, i think is in mkv file, that has been created with mkvmerge 4.2.0. (nevest one). Index file is'nt created nor in automated script mode, nor with ffmsindex.exe (error message - the same - "Indexing error: Can't create decompressor: Unsuported Compression method"). With files, made by older mkvmerge versions, ffms2 works fine.
What You think about that?

the error is generated when the mkv file has some kind of content compression within the mkv that is not ZLIB/LIBZ.
so your new mkvmerge is generating mkv files differently than it has before.

Wojszwillo
12th August 2010, 13:31
It seem's that "enhancement":
* mkvmerge: enhancement: Header removal compression has been enabled by default for MPEG-4 part 10 (AVC/h.264) video tracks with a NALU size field length of four bytes"

tebasuna51
12th August 2010, 15:08
Remux the mkv with:
"mkvmerge" -o "output.mkv" --compression -1:none "input.mkv"

TheFluff
14th August 2010, 20:41
http://www.mod16.org/ffms2/ffms-r322pre-avs.7z

Now with 100% more MKV header removal compression support. Go test it for me.

TheRyuu
19th August 2010, 18:09
ffms2-r325.7z (http://ffmpegsource.googlecode.com/files/ffms2-r325.7z)

Contains both vanilla ffmpeg and ffmpeg-mt ffms2 builds.

stax76
21st August 2010, 10:27
suggestion for thread title:

ffms2 source filter plugin (FFVideoSource/FFAudioSource)

AMED
22nd August 2010, 03:33
There seems to be a problem with the reported frame rate.

v3.25 reports 23.8091908091908 FPS
http://i36.tinypic.com/34ew3md.png

v3.18 reports 23.976 FPS (which is correct)
http://i34.tinypic.com/18zmli.png

TheFluff
22nd August 2010, 21:06
That's not really a bug. MKV's do not have a framerate, so FFMS2 makes one up by looking at the average frame duration. There is some code that tries to set it to a familiar fractional value (i.e. 24000/1001) if it appears to be close enough, but nothing with that has changed between r318 and r325, so I dunno why you'd get different results. Maybe it's libavformat being cute.

minda76
22nd August 2010, 21:29
i get 23,809 fps too with r325. with r3.18 is all ok. the index file created with r318 is 1.152 kb, with r325 only 65 kb.

don_h
23rd August 2010, 13:03
i get 23,809 fps too with r325.

I can confirm this. 23,809 instead of 23,976 fps.

cretindesalpes
23rd August 2010, 15:15
Same here.
Subtitle (String (FrameRateNumerator ()) + "/" + String (FrameRateDenominator ()))
now gives me 23833/1001 instead of 24000/1001 previously.

TheFluff
23rd August 2010, 16:34
I assume y'all are using TheRyuu's r325 build? Is it the same with both the -mt and the standard version?

minda76
23rd August 2010, 16:39
I am using standard r325 build and it is the same with -mt version

Sharktooth
23rd August 2010, 17:19
there is indeed something wrong with FPS detection...

TheFluff
23rd August 2010, 19:33
there is indeed something wrong with FPS detection...

You don't say, only five people reported it before you!

ffms2-r327.7z (http://www.mod16.org/ffms2/ffms2-r327.7z) should fix the issue.
For the curious it was indeed related to libavformat being cute. FFMS2's detection of when to use the native matroska parser and when to use libavformat is pretty dumb and based on inspecting what name libavformat claims the format has. Recently some enterprising individual changed "matroska" to "matroska,webm" which broke the detection so libavformat got used instead of the native matroska parser, and I'm not that surprised to note that libavformat still kinda sucks at matroska.

Sharktooth
24th August 2010, 01:06
thanks for the fix :)
any chance for MT and 64bit builds?

Blue_MiSfit
24th August 2010, 04:02
I get similarly odd frame rates when decoding DVCProHD wrapped in an MOV container. AssumeFPS fixes it, but still :p

I don't imagine the same issue is responsible for this particular bit of weirdness :devil:

Derek

TheRyuu
25th August 2010, 02:38
thanks for the fix :)
any chance for MT and 64bit builds?

Can't help you with the 64bit part but I can with the former.

ffms2-r327.7z (http://ffmpegsource.googlecode.com/files/ffms2-r327.7z)

Contains both vanilla ffmpeg and ffmpeg-mt. Anyone using the r325 build should upgrade to this one to fix the parser bug.

Sharktooth
25th August 2010, 03:39
Thanks again for your help. Ill try to get the sources and compile a 64 bit version.
however im scared of compiling all dependencies...

kemuri-_9
25th August 2010, 04:05
the avs C/x64 plugin branch now has HEAD merged to it - making it become r328.
I just built it with generic ffmpeg and can be found here (http://kemuri9.net/dev/avs/ffms2/ffms2-x64.zip)

If you desire otherwise, you can compile it yourself.

Sharktooth
25th August 2010, 14:37
thanks

livetolove92
7th September 2010, 03:01
Can anyone show me the command line to use ffmsindex.exe ? I can't find it.
If I use the ffindex in meGUI, i can't index some mkv and files larger than 10GB.

kemuri-_9
7th September 2010, 05:01
Can anyone show me the command line to use ffmsindex.exe ? I can't find it.
If I use the ffindex in meGUI, i can't index some mkv and files larger than 10GB.

using ffmsindex without any options prints the available command line options.

livetolove92
7th September 2010, 13:05
Can you show me the command line? I can't find it.

buzzqw
7th September 2010, 13:33
C:\>ffmsindex.exe -f Test.m2ts test.index
Writing index... done... 100%

BHH

livetolove92
7th September 2010, 14:57
Thanks very much :D.

rack04
7th September 2010, 21:00
Can someone please upload a zip file of the latest svn checkout? For some reason I keep getting the following message:

svn checkout http://ffmpegsource.googlecode.com/svn/trunk/ ffmpegsource-src
svn: Server sent unexpected return value (405 Invalid Method) in reponse to PROPFIND request for '/svn/trunk'

kemuri-_9
8th September 2010, 00:30
checkout works fine here.

rack04
10th September 2010, 14:39
checkout works fine here.

Must be something with the connections settings at work. I can access it on my home pc.

Underground78
10th September 2010, 21:37
@rack04: try https, it has already worked for me when I had this error.

stax76
12th September 2010, 15:42
It's seems there is a memory leak with all transport streams.

kemuri-_9
12th September 2010, 16:33
It's seems there is a memory leak with all transport streams.

which demuxer is being used? (libavformat or haali)
does a leak similarly occur with ffmpeg?

stax76
12th September 2010, 17:20
I've looked in Process Explorer which shows Haali DLLs so yes I think Haali is used.

I'm not sure what's the easiest method to check it with ffmpeg.

stax76
12th September 2010, 23:13
Some more info.

MediaInfo source file:

General
ID : 1
Complete name : D:\Video\Samples\M2TS\1080p - AVC - DTS-HD - Die Another Day.m2ts
Format : BDAV
Format/Info : Blu-ray Video
File size : 404 MiB
Duration : 2mn 11s
Overall bit rate : 25.8 Mbps
Maximum Overall bit rate : 35.5 Mbps

Video
ID : 4113 (0x1011)
Menu ID : 1 (0x1)
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4.1
Format settings, CABAC : Yes
Format settings, ReFrames : 4 frames
Duration : 2mn 11s
Bit rate mode : Variable
Maximum bit rate : 37.0 Mbps
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate : 23.976 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Color primaries : BT.709-5, BT.1361, IEC 61966-2-4, SMPTE RP177
Transfer characteristics : BT.709-5, BT.1361
Matrix coefficients : BT.709-5, BT.1361, IEC 61966-2-4 709, SMPTE RP177

Audio
ID : 4352 (0x1100)
Menu ID : 1 (0x1)
Format : DTS
Format/Info : Digital Theater Systems
Format profile : MA
Muxing mode : Stream extension
Duration : 2mn 11s
Bit rate mode : Variable
Channel(s) : 6 channels
Channel positions : Front: L C R, Side: L R, LFE
Sampling rate : 48.0 KHz
Bit depth : 24 bits

Text
ID : 4608 (0x1200)
Menu ID : 1 (0x1)
Format : PGS

avs script:

SetMemoryMax(128)
LoadPlugin("C:\...\ffms2.dll")
FFVideoSource("D:\Video\Samples\M2TS\1080p - AVC - DTS-HD - Die Another Day.m2ts")

When I open the script with VD and press Space to run the preview,
at the end of the 2 minutes clip, task manager shows 600 MB,
when I close the script, the memory is released. It seems to be
reproducible with all DVB or Blu-ray HD AVC TS. With ffplay only
constant 40 MB are used so no problem there.

TheFluff
13th September 2010, 00:38
I can't say I'm surprised. The entire Haali parser stuff is full of COM/ATL magic that I have absolutely no idea about how it works. Myrsloik knows more than I do but he's disappeared off the face of the earth.

LoRd_MuldeR
13th September 2010, 00:44
I never managed to get FFmpegSource2 decode my H.264 TS files (captured from DVB-S2) properly.

It always crashed randomly during the encoding process, sooner or later, although a quick preview of my AVS script looked okay.

And yes, I have Haali's Splitter installed ;)

The solution for me: Demuxing the original TS file with tsMuxR and then muxing the raw H.264/MP3 streams into MKV with MKVToolnix.

FFmpegSource2 handles the resulting MKV file perfectly fine and I can live with that procedure...

kemuri-_9
13th September 2010, 01:56
does the leak occur only with h.264 in TS or other video codecs as well?
(asking because i saw some special handling of h.264 in the haali demuxer code)

stax76
13th September 2010, 08:12
@LoRd_MuldeR

Looks like the same problem.

@kemuri-_9

IIRC it didn't happen with VC-1 and MPEG-2 but I'm not 100% sure, I can make some more tests if it helps, I've got a pretty complete sample collection. :)

TheFluff
13th September 2010, 12:00
If the same problem occurs with MKV's then it's something else than the COM magic and then it should definitely be fixed. Send me the sample file.

LoRd_MuldeR
13th September 2010, 12:07
If the same problem occurs with MKV's then it's something else than the COM magic and then it should definitely be fixed. Send me the sample file.

No, doesn't happen with MKV. That's the point! At east for me with MKV everything works perfectly fine :)

(Being able to access the TS file directly would still be an important advantage though)

Uploading a sample will be difficult, as it happens randomly after 1-2 hours of encoding. And the TS files usually are ~10 GB in size. A short snippet won't reproduce the issue.

In case you have access to a DVB-S2 card, you can produce a sample file yourself easily though...


Myrsloik knows more than I do but he's disappeared off the face of the earth.

Obviously he isn't hiding too deep in the ground ;)

Last Activity: Yesterday 15:18

kemuri-_9
13th September 2010, 13:05
@kemuri-_9

IIRC it didn't happen with VC-1 and MPEG-2 but I'm not 100% sure, I can make some more tests if it helps, I've got a pretty complete sample collection. :)

it would help us nail down exactly what section of code is exactly being problematic,
e.g. the entire haali demuxer or just the h.264 special handling within it

TheFluff
13th September 2010, 13:07
In case you have access to a DVB-S2 card, you can produce a sample file yourself easily though...

As a matter of fact, I do. I guess I'll cap some stuff.
I'm not that interested in maintaining the Haali dshow parser stuff though, since it's not crossplatform. I'd rather write a better TS parser from scratch myself, but that takes time, which I don't have too much of right now.

LoRd_MuldeR
13th September 2010, 15:22
I just want to confirm that the crash I was experiencing really is related to the memory leak:
* http://mulder.brhack.net/temp/ffms2_memleak_1.png
* http://mulder.brhack.net/temp/ffms2_memleak_2.png

The script I use is really simplistic:
FFmpegSource2("ArteHD.ts", atrack=1)

stax76
13th September 2010, 16:31
@TheFluff

Some more tests showed it's AVC specific. Is raw AVC supported? That would possibly be more useful then AVC in TS and easier to add, I'm guessing here. :)

@LoRd_MuldeR

Even if there wouldn't be the memory issue there would possibly be sync issues, somebody posted in the German board that tsmuxer helps with sync issues. I tested it with a sample capture that has a error and tsmuxer fixed that when remuxing ts, I don't know if the error correction is applied when demuxing.

LoRd_MuldeR
13th September 2010, 17:14
Having to pipe the TS file trough tsMuxR once (TS to TS), before processing it with FFmpegSource, still would be one step less than my current work-flow (TS to "raw" to MKV).

stax76
13th September 2010, 17:24
What is your current work-flow? In case it's tsmuxer > mkvmerge > ffms2 you can try DGDecNV instead if you capture much and have a Nvidia card.

LoRd_MuldeR
13th September 2010, 17:26
What is your current work-flow? In case it's tsmuxer > mkvmerge > ffms2

Exactly.

you can try DGDecNV instead if you capture much and have a Nvidia card.

I do have a Nvidia card (GTX260), but I don't have a DGDecNV license. And I'm currently not planning to buy one (as I don't have a PayPal account or Credit Card and don't plan to get one).

BTW: DGAVCDecode fails on my streams. It crashed reproducible. I guess that is because of the hopelessly outdated libavcodec that it uses...

Guest
13th September 2010, 19:47
All developers get free licenses. Send me a PM with your email addie for registration if you want it.

TheFluff
22nd September 2010, 00:30
http://www.mod16.org/ffms2/ffms2-r338.7z

Go test this. Fixes a heap corruption/crash and possibly a memleak when using Haali's splitter on a h264 ts.

This will become 2.14 unless someone complains.

LoRd_MuldeR
22nd September 2010, 00:57
Sorry, but I still get constantly increasing "private bytes" until it crashes:

http://img194.imageshack.us/img194/5852/ffms2memleak3.th.jpg (http://img194.imageshack.us/img194/5852/ffms2memleak3.jpg)

kemuri-_9
22nd September 2010, 03:46
It still doesn't look like that the bitstream filtering is being done correctly...

try and see if ffms2-maybe-fix.rar works fine
(been a loooong time since i built ffms2 through visual studio, so it may be a bit bumpy)
It'll probably either explode magnificentally or work as intended.
patch is included...

LoRd_MuldeR
22nd September 2010, 10:06
Thanks kemuri-_9, but no luck either:

It takes some time to index and then crashes reproducible:

http://img843.imageshack.us/img843/6964/ffms2memleak4.th.jpg (http://img843.imageshack.us/img843/6964/ffms2memleak4.jpg)

asarian
25th September 2010, 13:58
So, where's the 2.14 release then? All I see on google code page is 2.13 still.

Myrsloik
25th September 2010, 14:07
http://www.mod16.org/ffms2/ffms2-r338.7z
This will become 2.14 unless someone complains.

Then kemuri objected... he'll probably make the release cycle longer than for CCCP by objecting.

asarian
25th September 2010, 14:29
Then kemuri objected... he'll probably make the release cycle longer than for CCCP by objecting.

Thanks for the clarification. I merely looked at the changelog on the first page. My bad.

kemuri-_9
25th September 2010, 14:49
Then kemuri objected... he'll probably make the release cycle longer than for CCCP by objecting.

huh? Are you implying that I'm at fault here?
I was just trying to fix the issue that LoRd_MuldeR is still reporting that was supposedly already fixed.
but my change just broke more stuff, so it should be ignored....

2.14 can go out as long as its noted to not use it with h.264 in TS which causes a severe memory-leak and will likely lead to a crash.

Myrsloik
25th September 2010, 14:59
Yes, I'm shifting blame like a pro and there's nothing you can do about it. I'll poke TheFluff about preparing 2.14 for release immediately.

kemuri-_9
25th September 2010, 16:04
I'm willing to spend some time to try and figure out the issue in the mean time,
but i particularly need an AVC in TS sample to do so as i don't have any atm.

LoRd_MuldeR
25th September 2010, 16:12
I'm willing to spend some time to try and figure out the issue in the mean time,
but i particularly need an AVC in TS sample to do so as i don't have any atm.

Well, I can provide one easily. But uploading will take some time. Did I mention my upstream is SLOW ???

kemuri-_9
25th September 2010, 16:32
Well, I can provide one easily. But uploading will take some time. Did I mention my upstream is SLOW ???

well it's whenever you can,
In the meantime i have a new theory as to the leak's cause and have made a new build around that and am awaiting the sample for confirmation.

asarian
25th September 2010, 16:55
This is the full todo list for FFMS2. Vote on the features you want or suggest your own. I'm personally guessing 2-5 are what people want mostly but I could be wrong...


Request: add 'fps=' parameter to FFVideoSource (especially needed for mkv at times).

TheFluff
25th September 2010, 16:59
It would be nice to have that bug fixed in 2.14. I'll wait and see if kemuri's patch is successful.

Request: add 'fps=' parameter to FFVideoSource (especially needed for mkv at times).
RTFM, it's already there (at least its functional equivalent). Unless you want something like assumefps(), but if you want that just use assumefps().

Underground78
25th September 2010, 17:39
I'm willing to spend some time to try and figure out the issue in the mean time,
but i particularly need an AVC in TS sample to do so as i don't have any atm.

If it can help, here an AVC in TS sample I uploaded previously for other use : http://www.mediafire.com/?g2xjd4rwa2n.

TheFluff
25th September 2010, 19:33
http://www.mod16.org/ffms2/ffms2-r339.7z probably fixes the issue, thanks to kemuri-_9.

LoRd_MuldeR
26th September 2010, 01:54
http://www.mod16.org/ffms2/ffms2-r339.7z probably fixes the issue, thanks to kemuri-_9.

Great, testing now...

LoRd_MuldeR
26th September 2010, 02:12
Great job! Loos like the issue is fixed indeed:

http://img840.imageshack.us/img840/7416/ffms2memleak5.th.jpg (http://img840.imageshack.us/img840/7416/ffms2memleak5.jpg)

:thanks:

stax76
26th September 2010, 11:47
Fantastic, thanks everybody! :thanks:

It's also fixed in my test, similar source then mulder and the user who originally brought it to my attention, I'll report to him. :thanks:

asarian
26th September 2010, 16:21
Fantastic, thanks everybody! :thanks:

Yes, appreciate the fast fixes. :) Looking forward to the 2.14 release.

Sharktooth
27th September 2010, 16:51
any chance for MT and a 64bit build (including mt as well)?

TheRyuu
27th September 2010, 17:09
any chance for MT and a 64bit build (including mt as well)?

After it's official I'll make 'em.

Sharktooth
27th September 2010, 17:38
thanks

stax76
28th September 2010, 21:38
I don't know if this is a known problem, MakeMKV generated AVC MKV, result in macro blocks for a while when seeking, this makes such files unusable since seeking is needed for preview, cropping, cutting etc. If I use eac3to instead to create a AVC MKV from any Blu-ray source it works. Sorry I my upstream speed of my internet connection is very slow, I hope somebody can upload a sample. I'll point the MakeMKV author here.

TheFluff
28th September 2010, 23:35
The problem with AVC in MKV remuxed from a ts or m2ts is known.

stax76
29th September 2010, 00:20
Only post I found is a changelog entry posted by Myrsloik:

Fixed h264 in mkv which was remuxed from bd sources, there are no longer decoding artifacts after seeking

TheRyuu
29th September 2010, 09:41
Only post I found is a changelog entry posted by Myrsloik:
Fixed h264 in mkv which was remuxed from bd sources, there are no longer decoding artifacts after seeking

Certain streams still exhibit artifacts. Before almost all of them did, now only some of them do.

tebasuna51
29th September 2010, 10:24
The problem with AVC in MKV remuxed from a ts or m2ts is known.
Can you explain the problem, or put a link to explanation, please?

TheFluff
29th September 2010, 11:39
grab h264 m2ts from bluray -> remux to mkv -> decode with ffmpegsource -> lol artifacts

sometimes remuxing it again with mkvmerge (not gdsmux or eac3to or anything else) fixes it for some reason

stax76
29th September 2010, 12:02
mkvmerge nor Haali's muxer which eac3to uses cause this problem, only MakeMKV's muxer so I hope the MakeMKV author will help, I've already pointed him to this thread.

TheFluff
3rd October 2010, 23:49
2.14 is finally out, grab it from the Google Code (http://code.google.com/p/ffmpegsource/) page. ffmpeg-mt and avs64 versions aren't posted yet as of this writing, but I'm pretty sure TheRyuu and kemuri-_9 will post them soon.

This is mostly a bugfix release, and it fixes a bunch of rather critical issues. Full changelog since 2.13:

Reworked filename handling a bit. Index files should no longer get a garbled name when using the Avisynth plugin and an input filename in the local codepage (issue 9), and FFMS_USE_UTF8_PATHS does no longer require patching ffmpeg. (TheFluff, nielsm)
Fixed a bunch of compiler warnings and added versioning for the shared library when building under Unix. (Kovensky)
Fixed an invalid memory access bug that could cause random crashes or other errors when opening files. (TheFluff)
The timebase for video tracks is now corrected if it's invalid. (kemuri_-9)
Fixed a number of multithreaded decoding issues. (kemuri_-9)
Use aligned memory for audio decoding buffers; fixes some crashes during audio decoding. (greg)
Fixed a bug that caused ffmsindex -c to fail. (chdheu)
Added support for MKV files using header stripping compression. (TheFluff)
It is now possible to compile FFMS2 using a ffmpeg without libpostproc compiled in (this will obviously cause postprocessing-related functions to fail). Hence it is now possible to build a GPL-free FFMS2, since the rest of ffmpeg can be compiled as LGPL. (TheFluff)
Audio streams that change channel layout, sample rate or bitdepth mid-stream will no longer cause crashes; an error will be raised during indexing instead. (TheFluff)
Fix a potential crash when ffmpeg thought it couldn't decode a certain format, but was wrong. Fixes issues with some FLV's. (Plorkyeran)
Fix heap corruption that could cause crashes and odd issues when opening H.264 in MPEG-TS with Haali's splitter. (Plorkyeran)
Fix a memleak when decoding H.264 in MPEG-TS using Haali's splitter. (kemuri-_9)
Updated FFmpeg to rev 25329.

elguaxo
3rd October 2010, 23:57
:thanks:

TheRyuu
4th October 2010, 02:59
ffmpegsource-2.14-mt.7z (http://ffmpegsource.googlecode.com/files/ffmpegsource-2.14-mt.7z)
ffmpegsource-2.14-mt-avs64.7z (http://ffmpegsource.googlecode.com/files/ffmpegsource-2.14-mt-avs64.7z)

ffmpeg-mt flavor with some avs64 topping.

michaelusa
4th October 2010, 17:05
Pardon my ignorace, What is the difference between the ffmpegsource vanilla and mt flavors? Which one should I use? I'd like to use it as a plugin for AviSynth. Thanks.

Myrsloik
4th October 2010, 19:15
FFmpeg-mt is a branch of FFmpeg with multithreaded video decoding for most formats. The only difference is which library FFMS2 is linked against. In theory the mt compiles should be faster with no drawbacks at all.

asarian
4th October 2010, 19:34
Thanks for the 2.14 version! Much appreciated.

asarian
5th October 2010, 23:25
Kemuri, is there a reason why the index now seems to get rebuilt every time I call the same script with FFVideoSource in it? That takes an awful lot of time each time.

EDIT: Okay, something is not entirely right. When I delete the index, prior to FFVideoSource rebuilding it (for as yet unknown reasons), the encoding goes well. If I don't, I get errors like these:


avs : 1920x796p 1:1 @ 24000/1001 fps (cfr)
x264 [info]: using SAR=1/1
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.2
x264 [info]: profile High, level 4.1
x264 [warning]: non-strictly-monotonic pts at frame 1 (2 <= 2)
x264 [warning]: non-strictly-monotonic pts at frame 2 (2 <= 3)
x264 [warning]: non-strictly-monotonic pts at frame 3 (2 <= 4)
x264 [warning]: too many nonmonotonic pts warnings, suppressing further ones
x264 [warning]: 69 suppressed nonmonotonic pts warnings
^CTerminate batch job (Y/N)? y


Clearly, there's something off with the rebuilding of the indices (for one, it should not have to rebuild/update/whatever) at all when the 'parent' movie hasn't changed. And secondly, whatever it changes, it messes things up.

Mind you, this [I]only occurs on the 64-bit version of FFmpegSource.

kemuri-_9
6th October 2010, 00:49
and whose 64bit avisynth build are you using?

I have not changed anything in the core avisynth C code that would cause the code to regenerate the indexes every time, so indexes always regenerating should not be occurring unless you specified cache=false to FFVideoSource.

So it's something else that's causing the issue, as to what, dunno...

you're still probably using JoshyD's avisynth build which has been known to have issues,
so you'll have to compare the effect against squid_80's avisynth x64 build based on avisynth 2.55 or so and see if the issue occurs there as well.
If you're using the MT avs64 build, then try the generic avs64 build...

and so on and so forth until you can tell me what's causing it.

asarian
6th October 2010, 01:01
and whose 64bit avisynth build are you using?

...
you're still probably using JoshyD's avisynth build which has been known to have issues,


Yep, still using that one, at: http://forum.doom9.org/showthread.php?t=152800

Didn't even know there was an alternative, to be honest.


I have not changed anything in the core avisynth C code that would cause the code to regenerate the indexes every time, so indexes always regenerating should not be occurring unless you specified cache=false to FFVideoSource.


I just call it with these two lines:

LoadCPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins64\ffms2.dll")
FFVideoSource("f:\jobs\stargate.mkv").ConvertToYV12()

Yet index is rebuilding constantly (whenever I call the script).


So it's something else that's causing the issue, as to what, dunno...


Not a whole lot to be found on the "non-strictly-monotonic pts" errors, except it seems to be related to some sort of internal avisynth resizing bug (but one which should have been fixed a long time ago, if I read things right; so I'm still unclear what's causing it).


so you'll have to compare the effect against squid_80's avisynth x64 build based on avisynth 2.55 or so and see if the issue occurs there as well.
If you're using the MT avs64 build, then try the generic avs64 build...

and so on and so forth until you can tell me what's causing it.


That's gonna take a bit of looking into. Anyway, thanks for your time.

kypec
6th October 2010, 14:22
Results of your testing are eagerly awaited asarian, please post them later, thanks!
I'm planning to start using 64-bit Avisynth myself...

kypec
7th October 2010, 15:57
Is there any particular reason why 32-bit & 64-bit plugins cannot share the same *.ffindex file?
I'm using both 32-bit & 64-bit Avisynth on the same machine and the necessity to re-index same file every time I switch to another Avisynth environment is tedious.
If each FFMS2 build definitely needs specific version of ffindex file then please at least differentiate them by file extension (like ffindex & ffindex64 or anything else that suits developers better)
:thanks: A LOT!!!

Myrsloik
7th October 2010, 16:42
Yes, they do need to be different because you never know exactly how having FFmpeg compiled with different number of bits affects the timestamps. Just create a wrapper function if it's such a big problem. Or modify the avsi file.

Blue_MiSfit
7th October 2010, 23:15
What IS the suggested x64 build to use these days? JoshyD's build from April is the most current one I'm aware of...

Derek

TheFluff
7th October 2010, 23:17
my suggestion is to not use avs64 at all unless you really enjoy broken stuff

Hagbard23
7th October 2010, 23:31
[OFFTOPIC]

my suggestion is to not use avs64 at all unless you really enjoy broken stuff

Why? I never noticed broken stuff until now...tell me more...

TheFluff
7th October 2010, 23:56
read a few posts above?

SledgeHammer_999
8th October 2010, 00:04
Is anyone monitoring the bug tracker on the project's page?

kemuri-_9
8th October 2010, 01:48
Is anyone monitoring the bug tracker on the project's page?

If you were the one who posted about
Application crashes if FFMS2-avs64 is used and index file is from 32-bit flavour

It's not reproducable with the 32bit and 64bit versions i have made, the indexes are remade each time.
rather than being MT specific, I would say it's more likely because the 32bit version you're using is made by visual studio and the 64bit one is made by MinGW.

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.