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