View Full Version : dropped frames with directshowsource()
WBL
18th January 2010, 13:22
Hello,
I'm editing stereoscopic videos (using two streams, one left and one right).
I found a problem when loading videos using
directshowsource()
In this case AviSynth seems to drop frames (single or multiple) wich ends in missynched stereoscopic video (I load these streams with StereoMovieMaker)
I am almost sure this bug is rooted in the directshowsource DLL since I did the following test:
- using directshowsource with MPG2 files Avisynth drops frames (it uses ffdshow directshow filter)
- using VirtualDub loading the MPEG2 file (with mpeg2 plugin from fcchandler), then frameserving it and loading it via Avisynth as AVISource all is fine - no dropped frame at all
conclusion: there seems to be a bug when loading via directshowsource - can someone confirm this? Could it be also a problem of the filter used (in this case ffdshow)?
thanks
Werner
-
wonkey_monkey
18th January 2010, 13:42
I'm not sure, but I've read a few times that DirectShowSource isn't frame accurate. For MPEG2 files I always use DGDecode/DGIndex, available here (http://neuron2.net/dgmpgdec/dgmpgdec.html).
DGIndex is an executable which parses MPEG2 and creates a .d2v file (and can do other useful things), which dgdecode (an AviSynth filter) uses to open the MPEG2 with AviSynth.
David
WBL
18th January 2010, 13:56
which parses MPEG2 and creates a .d2v file
well thats what I want to avoid - I would like to load these files direct in AviSyth - in fact I have a workaround for MPEG2 files using VirtualDub but this problem is also present when loading e.g AVCHD files shot with a camcorder which uses h.264 compression
Werner
Didée
18th January 2010, 14:12
DirectShowSource is frame-accurate, as far as Avisynth is concerned. What might be not frame-accurate is the employed DirectShow Decoder Filter. (When Avisynth says "dear decoder, gimme frame #5678", and the DS decoder delivers frame #5691, saying "here you have frame #5678", who is to blame then?)
Usually you're fine when the chain is a straightforward DSSource+filter+filter, i.e. when the source is read in a strictly linear way from start to end. Problems will arise as soon as you force the decoder to "seek" in the file, for example when you use "trim()" statements (or similar filters) in the script.
If you post your script, it should be easy to see if it's problematic with DirectShowSource.
In case of doubt, use DGindex.
Alternatively, try using the external DirectShowSource2() filter. It is said to be reliably frame-accurate (note I never tried it personally).
WBL
18th January 2010, 14:26
when the source is read in a strictly linear way from start to end. Problems will arise as soon as you force the decoder to "seek" in the file,
well in my case I do only apply some filters but no seek within the AviSynth script, but when loading theavs files in StereomMovieMaker it is true that this application my seek or try to read a specific frame
Alternatively, try using the external DirectShowSource2() filter.
Ok i could try this - is this an additional external plugin? if yes where can I get it (never heard of it before)?
Werner
Didée
18th January 2010, 14:43
Part of Haali's package: link (http://lmgtfy.com/?q=directshowsource2) ;)
WBL
18th January 2010, 15:10
pointing me to google search is not the answer I expected - yes I have Halli media splitter installed - I also copied the file avss.dll to the pluginsfolder of AviSynth - but when trying to use
directshowsourc2()
I get an script error saying:
'there is no function namend "DirectShowSource2"'
So how is the correct use of this filter? cannot find any redme file eplaining it
Werner
Guest
18th January 2010, 15:12
It's DSS2().
WBL
18th January 2010, 15:31
It's DSS2().
:thanks:
is works so far - I will test frame accuret serving in the next hours
Werner
WBL
19th January 2010, 12:50
well, it still does not work frame accurate.
Werner
Guest
19th January 2010, 15:29
well, it still does not work frame accurate. Frame accuracy with DSS2 requires the presence of continuous PTS timestamps. If you have an elementary stream or a PTS discontinuity, it's all over.
Now you know why people do indexing to achieve robust frame accuracy.
poisondeathray
19th January 2010, 15:57
You can try ffmpegsource2 (use seekmode=0)
It will index your file automatically, if you use the .avsi function ffmpegsource2
But I still find DGIndex more consistent
hydra3333
20th January 2010, 12:56
I can't go past DGIndex for these things. Magnificant tool - can't understand your reluctance.
7ekno
20th January 2010, 23:47
well thats what I want to avoid - I would like to load these files direct in AviSyth
Well clearly you won't be able to avoid it if your source is missing needed timestamps ... unless you index at time of loading with FFMpegSource2 or DGIndex ...
D2V files load directly into Avisynth, so what is the real reason for trying to avoid indexing (because it needs to happen for accurate frames with absent timestamps)?!?
7ek
WBL
21st January 2010, 06:45
so what is the real reason for trying to avoid indexing
the extra work which needs to be done - imagine I have ybout 1000 single clips from two camcorders...
hydra3333
21st January 2010, 11:19
Put em in a folder and create a batch file which loops through them all using dgindex in command mode and come back in the morning. then you have all the .d2v "input files" as well, no extra work. that's what used to do, before i lost it in a rebuild.
StainlessS
21st January 2010, 13:32
You can also set up DGIndex to produce *.AVS files for each input file, from a template,
automating the process a little more. (they would all have identical filters, only the input
file names would be inserted).
HeadlessCow
21st January 2010, 23:41
You can use something like this:
for %%F in (*.vob) DO "C:\Program Files (x86)\megui\tools\dgindex\DGIndex.exe" -IF=[%%F] -OF=[%%~nF] -TN=a0 -OM=1 -EXIT
for %%G in (*.d2v) DO (
echo video=Mpeg2Source^(^"%%G^"^) >> %%~nG.avs
echo audio=WavSource^(^"%%~nG Ta0 48K 16bit 2ch.wav^"^) >> %%~nG.avs
echo AudioDubEx^(video, audio^) >> %%~nG.avs
)
in a bat file to handle all the files automatically. It processes all the vob files, then creates avisynth scripts for each with the video and audio sources loaded and then dubbed together.
In the first loop, adjust the filename filter (*.vob) to match your files and fix the path to DGIndex.
You can also tweak the second loop to put exactly what you want into the AVS files.
hydra3333
22nd January 2010, 05:18
Does it handle spaces in filenames ? :)
HeadlessCow
22nd January 2010, 15:03
It actually should handle them no problem.
HeadlessCow
22nd January 2010, 15:06
Actually... it might have a problem with spaces in the
>> %%~nG.avs
bit, if so, change it to
>> "%%~nG.avs"
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.