Page 1 of 2

Avifil32_ext - Userlibrary

Posted: Sun Jan 15, 2006 3:37 am
by inc.
Hi,

although PB internal imho provides the interface of IAVIFILE and IAVISTREAM ... most of the API Commands of the AVIFIL32 Library are not accessable by PBs default.
So I did build a wrapper-Userlibrary containing the missing functions for avifile handling under Windows.

The AVIFileInit_() function beside its main purpose does first load the system Library "avifil32.dll", where the AVIFileExit_() function beside its main purpose does close it finally.

The library is done using DLL2PBLib and TailBite.
All avifil32.dll Library calls are done internally using CallFunctionFast().

Download: Avifile32_ext_1.1.zip
(Updated, see inside)


So the following Avifil32 API functions are now directly in PB accessable.
(The Constants/Residents are provided via the "Avifil32_ext.res" file.)

AVIFileInit_
AVIFileExit_
AVIBuildFilter_
AVIClearClipboard_
AVIFileAddRef_
AVIFileCreateStream_
AVIFileEndRecord_
AVIFileGetStream_
AVIFileInfo_
AVIFileOpen_
AVIFileReadData_
AVIFileRelease_
AVIFileWriteData_
AVIGetFromClipboard_
AVIMakeCompressedStream_
AVIMakeFileFromStreams_
AVIMakeStreamFromClipboard_
AVIPutFileOnClipboard_
AVISave_
AVISaveOptions_
AVISaveOptionsFree_
AVISaveV_
AVISaveW_
AVIStreamAddRef_
AVIStreamBeginStreaming_
AVIStreamCreate_
AVIStreamEndStreaming_
AVIStreamFindSample_
AVIStreamGetFrame_
AVIStreamGetFrameClose_
AVIStreamGetFrameOpen_
AVIStreamInfo_
AVIStreamLength_
AVIStreamOpenFromFile_
AVIStreamRead_
AVIStreamReadData_
AVIStreamReadFormat_
AVIStreamRelease_
AVIStreamSampleToTime_
AVIStreamSetFormat_
AVIStreamStart_
AVIStreamTimeToSample_
AVIStreamWrite_
AVIStreamWriteData_
CreateEditableStream_
EditStreamClone_
EditStreamCopy_
EditStreamCut_
EditStreamPaste_
EditStreamSetInfo_
EditStreamSetName_
IID_IAVIEditStream_
IID_IAVIFile_
IID_IAVIStream_
IID_IGetFrame_
mmioFOURCC_
AVIFileClose_
AVIStreamClose_
AVIStreamEnd_
AVIStreamEndTime_
AVIStreamFormatSize_
AVIStreamLengthTime_
AVIStreamSampleSize_
AVIStreamSampleToSample_
AVIStreamStartTime_
AVIStreamNextSample_
AVIStreamPrevSample_
AVIStreamNearestSample_
AVStreamNextKeyFrame_
AVStreamPrevKeyFrame_
AVIStreamNearestKeyFrame_
AVIStreamIsKeyFrame_



An example of a complete AVI Player using some of these API calls will follow these days ;)

I hope it useful.

Greets
Inc.

Posted: Sun Jan 15, 2006 4:29 am
by Intrigued
This definitely is interesting to me.

I'm looking forward to your example(s). Thanks for sharing your expertise for those of us new to PB. It really goes along way, sometimes quietly as you get no feedback here in the forums, in helping us out.

*double thumbs up, followed with salute, followed by a beer*

:wink:

Posted: Sun Jan 15, 2006 1:38 pm
by SoulReaper
Yes a very nice add on :)

Just goes to show what pure basic can do! with the help of tailbite!
congrats on the new libary :wink:

Posted: Sun Jan 15, 2006 10:50 pm
by Intrigued
Q. Will you be adding in a Help file?

TIA

Posted: Sun Jan 15, 2006 11:25 pm
by swan
Great ! Just the ticket.
Looking forward to the examples.

Well Done ...

Posted: Mon Jan 16, 2006 6:01 pm
by inc.
Ok, here it goes ....

Here you can get an example code of an avi file player using the library released above.

The code is well documented so you I hope you can follow the approach of using the AviFil32 API.

This code also needs a new library I release called "AviAudio".
This library bases on an example C code of microsoft where its shown how to playback audio with continously audiobuffer refilling. I made a PB library of it and I hope it works. I tested it on PB 3.94!.

Get the "AviAudio" Library here
(helpfile included)

@Intrigued

Regarding to a helpfile of AviFil32_ext, these functions are just wrappers for the AviFil32 Windows API. So if you need more infos then showed in the example code above, please look at the Windows Multimedia SDK if you need further/detailed informations:
http://msdn.microsoft.com/library/defau ... ctions.asp
(The AviFile Macros showed in the SDK link are btw. also included in the Avifile32_ext PB Library)
;)

Posted: Mon Jan 16, 2006 11:34 pm
by Droopy
Nice 8)

Posted: Tue Jan 17, 2006 12:25 am
by Intrigued
Thanks inc. on all accounts.

*thumbs up*

Posted: Sat Jan 21, 2006 5:13 am
by inc.
Update:
Download: Avifile32_ext_1.1.zip
The AviAudio Userlib is now included.
I also did add some nice easy functions for very simply building an AviFile Player. These new extra library functions do have almost the same logic and syntax as the PB's internal movie commands.
A helpfile and examplecodes are included also.

Posted: Sat Jan 21, 2006 2:57 pm
by Intrigued
inc. wrote:Update:
Download: Avifile32_ext_1.1.zip
The AviAudio Userlib is now included.
I also did add some nice easy functions for very simply building an AviFile Player. These new extra library functions do have almost the same logic and syntax as the PB's internal movie commands.
A helpfile and examplecodes are included also.
Thanks for the update!

Posted: Thu Nov 23, 2006 1:54 pm
by dige
@Inc. what about a pb4 compatible version?

Posted: Thu Nov 23, 2006 1:59 pm
by inc.
Yupp, I thought about that.
It would be sufficient if a simple pbi include file would just "import" those symbols from the avifil32.lib. The audio decoding unit also could be implemented as pure source code to that include file.

Posted: Thu Nov 23, 2006 2:40 pm
by Kukulkan
Is this Userlib available for PB4 and is there an example how to select a given codec (DivX) and creating a video out of single images? It is not allowed to gather informations from the user (codec must be selected by the program).

Is this possible?

Kukulkan

Re: Avifil32_ext - Userlibrary

Posted: Fri Feb 04, 2011 8:10 pm
by Zach
I really hate to keep digging up all your old threads (honestly!). But Idle pointed this Library out to me and it is exactly what I have been looking for (vs the stumbling I've done trying to teach myself the API).

Is there any chance we could get an updated version for 4.51? (Won't compile referencing the String Extension library - who knows what else after that) I'm mostly interested in using your "Easy" commands as they pretty much do everything I need. Or at least, could you release the source code so I or someone else could try to update it :wink:

Re: Avifil32_ext - Userlibrary

Posted: Tue Feb 08, 2011 12:30 am
by Zach
Ok.. Well I finally got sick of putzing around with the Avifile library stuff, after about a week now... I came soooo close, after copying some code Idle provided, but I just get a blank window when I open stuff up.. at first some junk about the image I'm drawing to not being initialized, but then I fixed that (I think) and its just a blank window...bleh

I went and got PB 3.94 since Inc said that was what he tested this library on, I had to make a minor correction in the "Aviplayer easy.pb" demo file that was included (changed "Use Image(0)" to the #Image gadget constant in the PlayAVI() procedure) but at least it opens and plays through a file! Seems a bit buggy with the pause/resume when seeking, but I think I will get around that when building my GUI and events from scratch (I hope).

Are there any really nasty bugs or performance issues with PB 3.94 that I should know about? I'm willing to code my application with it at this point (though I'll still work in private with Idle cause he has been super awesome) but don't want to end up with problems due to bugs or poor performance either..