View Full Version : AviSynth Complete DirectShow support (RC2)
sh0dan
3rd November 2003, 18:13
Hi!
I just had a "vision" on how to simplify and fix most of the problems I've experienced with DirectShow, and it seems like I succeeded! :)
The november 3rd CVS Binary should now have complete audio and seeking support! Also audio sync problems should be fixed!
New options added:
video = true/false
audio = true/false
This will disable either one of them (but of course there is no point in disabling both). Both default true naturally.
Please test and report back!
(Someone also please test SegmentedDirectShowSource - I might have done something stupid to it).
Expect 2.5.3 soon if tests are positive!
DDogg
3rd November 2003, 21:52
I had a 16 gig DV type 2 file laying around. Works perfectly as I viciously and happily clicked all over the time line. Near instant response. Just in case nobody has told you this week, you are just amazing!
crOOk
3rd November 2003, 22:08
Great work sh0dan!
Karl Beem
3rd November 2003, 22:32
It does work! I have
play = DirectShowSource("NC96.avi",fps=29.97)
play = play.TomsMoComp(1,5,1)
return play
where NC96.avi is encoded *interlaced* with DivX 5.1.1. This plays nicely with ZoomPlayer on my monitor and the DivX 5 decoder is operative. The previous version would hang on seeking. In this case, the seeking is a little slow.
jonny
4th November 2003, 00:32
Great sh0dan!
Tested with a 5GB Avi (DivX 5 inside), seeking all around works perfectly
DDogg
4th November 2003, 02:12
sh0dan, MakeAVIS is failing with a player crash when audio is checked using:
directshowsource("d:\ntsc_DV_type2.avi",fps=29.97)
Link2 seems to sometimes work, but sometimes the audio has an echo. I can't pin it down any better than that yet.
DDogg
4th November 2003, 16:16
sh0dan, maybe you can replicate this:
load a ntscdvtype2.avi in the tmpg wizard as a 29.97 standard vcd. Note it gets the field order and interlaced correctly. Do a short encode. It is ok.
Now do the same using an avs with DS as source. Note field order is shown as tff and non-interlaced. Change to bff and interlaced. Do an encode. On my end the video is slowmo and audio is echoed, as if it is slowmo also.
OS-XPPro
/add: re SegmentedDirectShowSource
Using 4 100 frame segments of a ntscDVtype2 source, cap.00.avi,cap.01.avi,cap.02.avi,cap.03.avi
SegmentedAVISource("cap.avi") = OK
SegmentedDirectShowSource("cap.avi",fps=29.97) = No video. Audio wayyyy slloooooooow.
SegmentedDirectShowSource("cap.avi") = Video showed but slow as was audio.
I then tried the same tests using huffy segments and got the same results so maybe that rules out DV as the problem?
Cyberia
5th November 2003, 01:58
Oh NO! Seeking works as long as you dont use WMP9! (or an OCX)
Actually you exacerbated the WindowlessVideo problem I have been beating the drum about for the last six months. Now ALL DirectShowSource opened files cannot seek in WMP9 or WMP OCX controls.
Previously, you could not seek in these applications if there was no audio component of a file. Now you can't seek even if there is one. I was nearly certain this was an AviSynth issue, now that this build makes it worse, I am absolutely positive AviSynth is the cause.
I have a custom application I wrote to demonstrate this the WindowlessVideo issue and now ALL DirectShowSource files suffer from the issue. Please please please look into this! You will wipe out years of work on my own VB AviSynth GUI, as the Preview window will be essentially useless.
I posted a detailed thread on this at Neuron2's forum (although I originally beileved it was an MPEG2DEC issue, I discovered it happens when there is no audio component. KillAudio() reproduces it with any Source open) I have also posted several threads here about this. See below.
Fix this and I will bear you children!
I am not trying to be critical, in other situations, it appears to work as advertised and is a BIG improvement. Thanks, but please don't wipe out my coding work in the process.
Neuron2's Thread (http://neuron2.net/ipw-web/bulletin/bb/viewtopic.php?t=160)
Doom9 Thread (http://forum.doom9.org/showthread.php?s=&threadid=61219&highlight=WindowlessVideo)
WindowlessVideo Test Program (http://home.insightbb.com/~cyberia-1/WLVTest/WLVTest.zip)
sh0dan
5th November 2003, 09:51
@Cyberia: This is why this is only RC ;) I'll do some testing. I only have WMP8, but thanks for the test app.
Edit: Here the test-app only disables seeking if 1) No audio. AND 2) Windowless = true. It could be possible that you are missing a SyncSource in the loaded filtergraph, when there is no soundoutput (A timer is usually assigned to DirectSound Output), or a window. If there is no Sync Source. What's the point of Windowless=true?
@DDogg: Thanks for the report - Unfortunately Seeking in samples are _not_ sample exact in DirectShow, that will lead to small glitches if audio isn't accessed in a linear fashion. However it could also be a precision problem I've caused. Most problems should be fixable by using an audio cache, which would have to be written.
I'm sorry, but my "computer-time" is limited, due to some personal stuff. Hope you have patience!
Cyberia
5th November 2003, 19:37
@Shodan: Thanks, I was a bit shaken there.
Let me answer your questions back.
#1)
WindowlessVideo = TRUE allows you to overlay other controls on top of the playing image. (ie: cropping bars, buttons, text, etc) If WindowlessVideo = FALSE then the playing image moves to the top of the Z-order regardless of ANYTHING else. Thus, my cropping bars would still be there, but they would be BEHIND the image, and pretty useless at that point. Believe me, I have tried many variations/schemes/crazyideas to get around this. If there is a way, I haven't found it.
Its an obscure, barely documented, extremely important option!
(again, I need WindowlessVideo=TRUE)
#2)
Seeking is outright disabled if there is No Audio AND Windowless=TRUE, that's correct. BUT... try this:
AviSource(c:\mymovie.avi)
KillAudio()
WavSource(c:\anywav.wav)
Now the seek bar is ENABLED, but you still can't seek the video component. Only the Audio. This was true of the previous AviSynth release also. I intentionally chose AviSource in this example.
The same behavior can now be demonstrated with just DSS using:
DirectShowSource(c:\mympeg.mpg)
When Windowlessvideo=TRUE and there is Audio, the seek bar is ENABLED, but try using it... only the Audio seeks. If you add KillAudio() the seek bar is disabled again.
#3
It could be possible that you are missing a SyncSource in the loaded filtergraph, when there is no soundoutput (A timer is usually assigned to DirectSound Output), or a window. If there is no Sync Source.
I have only an indirect idea what you are saying here. I don't have to manually construct a filtergraph to play the video. In the test program you are using, this is literally ALL code needed to configure the player:
MediaPlayer1.FileName = "test.avs"
MediaPlayer1.Play
The player automatically loads and resizes itself when this is executed. I can then resize the Form around the player. It actually works very much like the standalone player, but in OCX form.
Speaking of the standalone player, I suspect this same issue (WindowlessVideo=TRUE) is the cause of the WMP9 seeking problem. The default setting for WMP6.4 seems to be WindowlessVideo=FALSE, and it does not have the seek problem. I assume WMP8 is the same, since it seeks fine. WMP9 must default to WindowlessVideo=TRUE (who knows why)
If you get adventurous, try "upgrading" to WMP9. It exhibits a very slight variation on the problem, but is otherwise the same. In WMP9 (standalone), if you open an AVS file containing KillAudio(), the seek bar actually WORKS for about one second, and you CAN SEEK during that time. Then video suddenly restarts and the seek bar disables and you can't seek! It's very odd.
Obviously, if you open the avi or mpg (or vob) directly in WMP9 then the file is seekable even if it has no audio. This is really whats pointing at AviSynth rather than a player bug. The player only has seek problems if the file is loaded via AviSynth. Directly loaded file work fine in all situation.
I can make a new version of the test program that allows you to load arbitrary files or scripts if you'd like.
I am very patient :)
Cyberia
6th November 2003, 01:58
In that whole post I forgot to mention this fact:
Once a video is loaded in the WMP ocx, it is possible to query the ocx about various parameters of the video (dimension, timelength, framerate, framecount, etc) and when WindowlesVideo=TRUE and the seek bar is disabled BOTH the Timelength and Framecount are zero.
I can also query the AVISTREAMHEADER directly via API calls, and the correct framecount and timelength are (apparently) present when this method is used. But it sure seems like WMP (ocx) cannot determine them for itself, but it gets the dimensions and framerate correct.
Cyberia
8th November 2003, 06:12
I have uploaded a new and improved version of the WindowlessVideo test program. This version allows arbitrary video and scripts to be loaded and also reports basic properties (resolution, framecount, timelength, etc) of the video.
You may forget my last post about Timelength and Framecount being reported incorrectly. While they ARE reported incorrectly, I now believe this to be an unrelated issue, but still an AviSynth problem. I will post a seperate thread about this new issue.
The functionality of the seek bar seems to be affected ONLY by the WindowlessVideo property regardless of the validity of the Timelength and Framecount.
The MediaPlayer seek bar is not available at all for videos without an audio stream loaded via AviSynth if WindowlessVideo is ENABLED. If WindowlessVideo is ENABLED and the video has an audio stream, the seek bar is enabled but only the audio component is seekable. If WindowlessVideo is DISABLED, the seek bar should be fully functional in all circumstances.
You can use the AviSynth function KillAudio() to remove the audio stream from a video.
Videos loaded directly (not through AviSynth) are seekable in all circumstances.
WindowlessVideo Test Program (http://home.insightbb.com/~cyberia-1/WLVTest/WLVTest.zip)
Mug Funky
8th November 2003, 18:35
hmm. i guess this will be a real problem and should probably wait for a future version of avisynth, but it seems certain RV and WMV files will lose sync after a short time. the frame count is what you'd get including the dropped frames, but the last frames are just duplicates. this is either from dropped frames or actual VFR content...
if it's just dropped frames then there shouldn't be much problem.
apart from that, brilliant!
PowerMacG4
9th November 2003, 08:25
How about a good QTSource too? ;-) If only it were that simple..
I had a few problems with plugin conflicts in my Avisynth Plugins folder (causing avisynth to crash on unload), but that was solved by removing all of the plugins, and then reinstalling. I believe I put avisynth_c.dll in there by accident, which screwed up the install somehow.
Anyway, problem fixed.
stickboy
10th November 2003, 03:00
Originally posted by PowerMacG4
How about a good QTSource too? ;-) If only it were that simple..I'm fine with the QTReader VFAPI plug-in, although I wish I knew exactly what determines the number of duplicate frames it generates.
Mug Funky
10th November 2003, 16:36
@stickboy:
just find out the framerate of the original file and go changefps(<rate>)... works for me. i can't see a problem with that method (well, haven't had any dupes yet).
why people use quicktime... tsk tsk
DDogg
10th November 2003, 16:55
I guess I must be the last person to know, but I was pleasantly surprised to see we can now open a readmedia file.
I installed an alternate directshow codec called "realalt110.exe" and the following script worked great:
directshowsource("g:\RMDVtest.rmvb",30).flipvertical()
sillKotscha
10th November 2003, 17:28
offtopic:
DDogg, there're better alternatives for downloading "real alternative v1.10" ... 'cause you should have had a closer look @ this site... little hint: 'Parent Directory' ;)
cheers Sill
DDogg
10th November 2003, 19:12
Hmm, doesn't look very legitimate does it? OK, I'll pull that link and anybody interested can just google on it. Thanks, Sill. I appreciate the heads up.
sh0dan
10th November 2003, 20:35
The Directshow Real Media Splitter and decoder in GuliverKLI (http://sourceforge.net/projects/guliverkli/) seems to have no legal problems - one of the Real Devs (Karl) are refering to it in the "New Codec" section here at d9. It works fine, and I've used it for frame-by-frame comparisons on my encodes.
DDogg
11th November 2003, 00:12
Is there anything equivalent for Quicktime files using DirectShow? Probably a dumb question but I can't keep up with all this stuff anymore.
stickboy
11th November 2003, 06:57
Originally posted by Mug Funky
just find out the framerate of the original file and go changefps(<rate>)... works for me. i can't see a problem with that method (well, haven't had any dupes yet).But how do you know the framerate of the original file?
ivanova
11th November 2003, 19:38
Anyone had any success loading VOBs? I tried it, but only got about 5 frames. Loading an AC3 file worked though.
Just curious, I know loading it with MPEG2DEC3 would be better. Wouldn't need the d2v file for DS though.
Good work :cool:
RadicalEd
12th November 2003, 04:02
Gabest's splitter is just a splitter, you still need RealOne (or the illegal RealAlt) installed for the decoding.
But.. yeah.. Real should probably just release a legal standalone version of the decoders.
xappy
21st November 2003, 21:38
So, is it now possible to open DV-files without any vfw DV-codec installed?
sh0dan
22nd November 2003, 15:02
Yes.
Mug Funky
23rd November 2003, 13:50
@stickboy:
use quicktime... it's under "get file properties" or some guff. takes a bit of looking (apple have never heard the words "interface" and "design"), but it's there.
usually the multiplier is 24. at least with all the sorenson 3 and mpeg-4 vids i've tried.
Cyberia
11th January 2004, 02:05
Shodan,
I've been patient. Any word on you looking into this problem? I'm at a point where I can't continue until it's resolved.
Thanks
Cyberia
Richard Berg
11th January 2004, 06:54
Wish I could help, but I'm several months behind in learning the DirectShow changes made last semester.
Cyberia
23rd January 2004, 22:45
Richard, I see that you have been compiling the DirectShow SDK stuff. Thinking about looking into this? Anyone else is welcome to look also.
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.