Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
2nd June 2003, 00:27 | #1 | Link |
Moderator
Join Date: Nov 2002
Location: Inside
Posts: 718
|
AviSynth framecount issue
I am writing an application that uses a mediaplayer ocx control, and from the control I determine the timelength and framecount of the playing video.
If I open an avi directly through the mediaplayer ocx, it reports the correct file attributes... the same than VirtualDub reports, that is. But if I open the avi through an avs script, the player reports the the timecount for BOTH timecount AND framecount. The timecount value is correctly reported, but I don't want it twice. Virtual dub reports the correct values for the file opened through Avisynth. The avs script is very simple: AVISource(myfile.avi) Although this could be a mediaplayer bug, it sounds like maybe AviSynth isn't reporting the framecount in the manner mediaplayer (ocx) wants it. Shouldn't AviSynth scripts work transparently in ANY application? |
2nd June 2003, 18:30 | #2 | Link |
Moderator
Join Date: Nov 2002
Location: Inside
Posts: 718
|
Ok, massive response so far.
Lets try tackling this from another angle: Does any have (or know of)an example on how to query the AVIFile or AVIStream API's from VB6? I have code trying to do this, but it returns inconsistent values between clips. I'd just like to see someone do it properly. Actually, even if you can't do that, can you tell me what calls I *should* be making in the correct order? (AVIFileOpen, then AVIFileInit, ... read the struct ... AVIFileClose) I don't want to play the avi in this way, just to determine it's basic properties (height, width, framecount, timelength etc) Sorry if I am being retarded. |
3rd June 2003, 04:01 | #3 | Link |
Moderator
Join Date: Nov 2002
Location: Inside
Posts: 718
|
Nevermind, I got it. Actually I had it, but had a typo.
Thanks to everyone who responded! Out of gratitude for all you help I have decided to give everyone who has posted so far ALL THE MONEY I HAVE. Couldn't have done it without you. You know who you are. EDIT: If anyone is interested, I decided to release an example. So here it is: AviStreamInfo using VB6 Last edited by Cyberia; 3rd June 2003 at 05:50. |
8th June 2003, 17:13 | #5 | Link |
Retired AviSynth Dev ;)
Join Date: Nov 2001
Location: Dark Side of the Moon
Posts: 3,480
|
@Cyberia: I don't know anyone here who works with VB, so that may be the reason for the lack of responses. Glad you got it resolved in the end!
@fisix: Remember rule 11, please.
__________________
Regards, sh0dan // VoxPod |
8th June 2003, 19:30 | #6 | Link |
Moderator
Join Date: Nov 2002
Location: Inside
Posts: 718
|
@fisix: Sorry the offer was only good until I posted the code. Too Bad.
@Shodan: Yea, I understand most people are not coding in VB, but all I needed was the name and order of the API calls (in any language) and I could transcode it to VB. I think most people would be surprised at how fast and powerful VB is now (obviously NOT for intensive apps, but for small simple apps its GREAT) FYI: There are FIVE API calls necessary for this operation - (EDITED) AviFileInit AviStreamOpenFromFile AviStreamInfo AviStreamRelease <--- Dont forget this one!! AviFileExit Last edited by Cyberia; 10th June 2003 at 18:38. |
10th June 2003, 18:37 | #7 | Link |
Moderator
Join Date: Nov 2002
Location: Inside
Posts: 718
|
Crap. There is a BAD BAD BAD memory leak in the posted code. This is such a stupid mistake, sigh.
I completely forgot to release the stream when finished. The problem gets worse as you try to test more and more videos because the previous stream was not freed, but a new stream is created every time you scan a file. Fortunately, it seems that all memory is returned to the system when you close the program. I have the fix ready and will put it up when I get home tonight. So in the off chance anyone has looked at the code, don't use it. Get the update. EDIT: The update is now available at the above link. Last edited by Cyberia; 11th June 2003 at 00:15. |
16th April 2004, 13:28 | #12 | Link |
Registered User
Join Date: Oct 2002
Posts: 167
|
Example works with AviSynth version 2.08.
First not working version I've found is beta 2.5 (jan2003) Can somebody verify/falsify this fact please! For handyness the test exe from cyberia: Link Access to AVIFile library is necessary to extract and display frames from avs files => per filter preview in editors. Last edited by vion11; 16th April 2004 at 13:44. |
19th April 2004, 16:17 | #16 | Link |
Registered User
Join Date: Oct 2002
Posts: 167
|
Checking other ressources/samples I have no doubt code is correct
and in addition it runs perfect with old version. Would like to see a verification from w2k machine... It is simple: open *.avs and when dialog shows numbers => ok if dialog shows N/A => nok |
19th April 2004, 19:35 | #18 | Link |
Registered User
Join Date: Oct 2002
Posts: 167
|
It runs now, haven't find out exactly what was wrong.
(de+installed sp4, all codecs, wmp 9, wmp 6.4) Here are exe + sources to display frames extracted from avs file with visual basic 6.0. Many thanks to cyberia and shrinkwrapvb.com Link (50kb) no runtime library |
20th April 2004, 00:45 | #19 | Link |
Registered User
Join Date: Feb 2002
Posts: 1,195
|
hi,
instead of SetDIBitsToDevice24 api i suggest u the DrawDibDraw api. ++
__________________
AutoDub v1.8 : Divx3/4/5 & Xvid Video codec and .OGG/.MP3/.AC3/.WMA audio codec. AutoRV10 v1.0 : Use RealVideo 10 Codec and support 2 Audio Streams and Subtitles. |
Thread Tools | Search this Thread |
Display Modes | |
|
|