View Full Version : FFmpegSource
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 ;) )
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.