Log in

View Full Version : FFmpegSource


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

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!"