View Full Version : Which *source filter is the most suitable?
redfordxx
16th December 2011, 17:06
Hi I need this answer for my batcher but I decided to put it in special thread:
There are many diferent source filters (AviSource, MPEG2Source, MPEGDecoder, FFSource...).
There are media files, which can be opened only with one of them. But there are many which can be opened with more then one and then, which one to choose.
I don't know what can be the criteria but what comes to me now is (more or less sorted by importance):
- assuring audio sync
- framerate keeping (sometimes I had MPEG2Source with double framerate result with every other frame full green)
- interlaced processing ???
- postprocessing options
- some color conversion errors?
- frameacurate seeking
- ...
I know it depends on 1) codec 2) container. I also know that file extension does not necessarily imply the container.
But, it already happened to me, that file *.vlc got error when opening and when I renamed it to *.avi, all went fine.
Same goes for audio. Has maybe demuxing some benefit on a/v sync?
In my batcher I, at this moment, try first FFVideoSource and when error I try AviSOurce. I plan to introduce more filters, but first I want to be sure to make it correctly.
So, can anyone with knowledge in this area, put down some basic rules, which should a user follow to choose best source filter?
redfordxx
16th December 2011, 17:10
Maybe, we can put together some general purpose table like this:
Container MP4 MKV MPEG2-PS AVI WMV
AVC FFMS FFMS -
XViD,DivX FFMS FFMS AviSource
Typical extensions
AVI = *.avi, *.divx, ...
MPEG2-PS = *.vob, ...
WMV = *.wmv, *.wm, ...
TheFluff
16th December 2011, 18:02
TS/PS: dgindex and friends
Pretty much everything else: FFMS
Backup for stuff not supported properly by FFMS: AVISource/DSS(2)/various source-specific plugins (qtsource etc)
Raw image data: rawsource/sashimi
AVISource and DSS(2) are extremely unreliable from an "automagic" perspective, since their capabilities are completely dependent on third-party software that may or may not be installed on the user's system. AVISource in particular can often be a correct choice for AVI's, but you can't rely on that without knowing what the user's VFW environment looks like, so for automatic programs you distribute to random users it's very unsuitable as a general-purpose source filter.
redfordxx
16th December 2011, 19:19
So, what you are saying if it is MPEG2, it is better to use DGIndex and friend than FFMS, even if FFMS can read the file?
So, can I put it like this? Even when the extension suggests that it is not MPEG2, still try it:
try{MPEG2Source(*.whateverextension)}
catch(errmsg){FFVideoSource(*.whateverextension)}(the trying does not make sense in some obvious cases but it is easier to code than testing various file extensions)
Are there any important about the and friends area? For example I understand MPEGDecoder does not require indexing, which would be good for my "automagic" stuff. However are there any disadvantages?
gyth
16th December 2011, 21:06
So, can I put it like this? Even when the extension suggests that it is not MPEG2, still try it:
try{MPEG2Source(*.whateverextension)}
catch(errmsg){FFVideoSource(*.whateverextension)}
Mpeg2Source takes a .d2v index file which is generated by DGIndex.
AVCSource takes a .dga index file which is generated by DGAVCIndex.
So blindly trying to open random files won't work.
Indexing is suppose to make random-seeking frame-accurate.
FFMS support for transport/program streams is done through haali/directshow and seeking could be off by a frame or two. (not indexed??)
redfordxx
16th December 2011, 21:45
My bad.
I meant try{indexing} and if not OK, do it with FFMS.
And what would be good recomendation for wmv? I must say this is where I experienced mostly a/v sync problems.
I had one file (now deleted) where avisynth detected framerate somewhere around 29 and in fact it was 30fps, so the result was out of sync. (basically this is why I added framerate warning to the batcher)
vampiredom
16th December 2011, 22:03
I meant try{indexing} and if not OK, do it with FFMS.
You should be able to do this with the MpegAutoIndexSource (http://forum.doom9.org/showthread.php?t=162930) function, like:
try{MpegAutoIndexSource("foo.xyz")}
catch(errmsg){FFVideoSource("foo.xyz")}
And what would be good recomendation for wmv?
As for .wmv files, I have had luck with the Nvidia version of neuron2's tools, which has VC1 support, providing that you demux the video first (which gets handled automatically by MpegAutoIndex). I can't say this works for all .wmv files, however. Note that in order to use the NVidia version, you need a license from neuron2 and must set MpegAutoIndexSource(nv=true). VC-1 only works with that version of the indexer.
redfordxx
16th December 2011, 22:35
NVidia...is it related to hardware? Do I have to have NVidia GPU or something, or it is just name?
vampiredom
17th December 2011, 00:38
NVidia...is it related to hardware? Do I have to have NVidia GPU or something
Yes, it requires a CUDA-capable card from Nvidia, unfortunately. Neither DGIndex, DGAVCIndex nor the DiAVC version support VC-1. I can't say say that the NV version is the "best" (for fear of being slapped down by the old rule #12 deal) but it is the most versatile, format-wise, of all neuron2's indexer/decoder versions.
Gavino
17th December 2011, 01:47
I can't say say that the NV version is the "best" (for fear of being slapped down by the old rule #12 deal)
As far as I can see, the rule only forbids asking what's best, not saying what you think is best. :)
redfordxx
17th December 2011, 03:28
Yes, it requires a CUDA-capable card from Nvidia, unfortunately. Neither DGIndex, DGAVCIndex nor the DiAVC version support VC-1. I can't say say that the NV version is the "best" (for fear of being slapped down by the old rule #12 deal) but it is the most versatile, format-wise, of all neuron2's indexer/decoder versions.
Well, last time I checked, I don't have such stuff stuffed in my notebook.
But, this VC-1, it is bluray codec, isn't it? So, I don't expect it in batch encoding often. Or, am I mistaken?
vampiredom
17th December 2011, 05:50
Well, last time I checked, I don't have such stuff stuffed in my notebook.
Yeah, I know. Not everybody has a compatible video card, which is a shame. DGDecodeNV really does work very well with a great many sources.
Well, last time I checked, I don't have such stuff stuffed in my notebook.
I don't really know what batches you are running :) If you are batching stuff from VC-1 BluRay, then… Bob's your uncle.
You asked about .wmv files: Some ".wmv" files are WVC1 (VC-1) while others are WMV3 (Windows Media 9). I don't really know all the gory details about these containers and how they differ and their compatibility. I only know that the process I described will work with the bona fide VC-1 ones, not the WMV3 ones.
[At the risk of drifting off-topic, I would love to find a simple command-line way of losslessly converting/rewriting WMV3 -> WVC1, if such a thing is possible]
TheFluff
17th December 2011, 20:22
And what would be good recomendation for wmv? I must say this is where I experienced mostly a/v sync problems.
I had one file (now deleted) where avisynth detected framerate somewhere around 29 and in fact it was 30fps, so the result was out of sync. (basically this is why I added framerate warning to the batcher)
In general, you cannot rely on the framerate reported by Avisynth. Many containers (including WMV) support VFR, and then the reported framerate is completely meaningless (since Avisynth isn't even aware VFR exists).
redfordxx
17th December 2011, 20:27
And what would be the advice on videos, where the audio sync off and changing sometimes positive, sometimes negative. I believe it it means the source is vfr?
For example avc in flv?
With ffms is audio sync off, DSS says the filter graph manager won't talk to me and when I playback it in BS, it is fine with FLVsplitter+CoreAVC.
First wondering is already that DSS makes problems... I thought that when I can play the video in BSPlayer, it automatically works with DSS...
Any ideas?
This makes sync problems:
FFVideoSource(srcfile, threads=1)
This won't talk to me:
DirectShowSource(srcfile, audio=false, pixel_type="YV12", logfile="ds.log", logmask=-1)
TheFluff
18th December 2011, 08:33
And what would be the advice on videos, where the audio sync off and changing sometimes positive, sometimes negative. I believe it it means the source is vfr?
For example avc in flv?
There are only two options:
1) enforce CFR (fpsnum/fpsden parameters to ffms2, convertfps parameter for DSS)
2) export timecodes from the original file and add them back in when muxing.
redfordxx
20th December 2011, 01:42
Hi, I am trying to use MPEGAutoIndex and I am confused about one thing. For example in the log file is Aspect Ratio: 4:3 NTSC but when I open it in MeGui, it reports 1,367521 which is clearly not 4/3. Similarily 16:9 versus 1,823361 (and 1,823169 ???)
Can anyone explain how these standards work?
redfordxx
21st December 2011, 18:29
So I did some research and I am even more confused. I realized that e.g. 16:9 is "just a name" and one must know other info about the source to be able to choose correct AR. And that's where I am lost
At the moment I have found 3 types of SAR for 16:9 MPEG2
PAL 512:351 118:81 64:45
NTSC 5760:4739 40:33 32:27But I don't know which one when to use.
Then MPEG1... maybe is not the case and Aspect ratio which I can read in the logfile is really the one, or I have also to find the correct one somewhere else.
I read somewhere that MPEG1 has 14 aspect ratios, so I hope they are directly the ones
For example 4:3,625, which I remember from some DGIndex logfile.
Thanx to anyone for any enlightening.
R.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.