AVI read/write + more source released.

BlitzMax Forums/BlitzMax Programming/AVI read/write + more source released.

ozak(Posted 2006) [#1]
Check it out here: http://www.furi.dk/?page_id=56

The story about the NHSoft AVI tool is that they are closing down their business (to form another one with some other company) and since I wrote the source, the rights belong to me. And I'm releasing it to the public.


MonkeyBone(Posted 2006) [#2]
Outstanding....
Thanks


popcade(Posted 2006) [#3]
Great Lib, thanks for sharing ;)


Ziltch(Posted 2006) [#4]
Looks really good, Thanks.

If I can get this to work with OpenGL it could be just what I need.


ozak(Posted 2006) [#5]
You should be able to do that. Just update your texture with the data pointer you get from GetFrame() and all should be well.
Remember to use the glSubTexImage or whatever it's called for the fastest dynamic texture update :)


Ziltch(Posted 2006) [#6]
Thanks again for sharing this.

I am wondering if fullscreen capture is possible?


ozak(Posted 2006) [#7]
It should be very possible.
However, ATM it pops up a codec dialog but you could just init the AVI writer before changing to fullscreen. It can be disabled in the C code though if you specify a codec manually :)


Ziltch(Posted 2006) [#8]
Thanks, I will look at the c code.

I think I need to start/stop recording while fullscreen, as before going fullscreen how would you get its handle?


ozak(Posted 2006) [#9]
Well. I guess the handle is a pointer, so it will be set when you do the graphics call. Give it a try :)


Paul "Taiphoz"(Posted 2006) [#10]
this could be used in your game code for creating game video ?

looks nice im gona have a look at it.


ozak(Posted 2006) [#11]
Yep. Only on windows though :)


Paul "Taiphoz"(Posted 2006) [#12]
I think the first thing I might try with this is simple tool to stitch two avi's together.


taxlerendiosk(Posted 2006) [#13]
Every AVI I try with AVI Reader gets me an Init error :( Does it have to use particular codecs?


taxlerendiosk(Posted 2006) [#14]
Weirdly, AviSynth scripts ( http://www.avisynth.org/ ) do not give me an init error, and the window does appear to be set up for the correct dimensions - but the program immediately terminates as soon as it tries to actually draw a frame. It would be fantastic if this supported AviSynth... should it do, when it's working properly? I still can't get any video at all.


Aymes(Posted 2006) [#15]
yeah same problem here too - would love to use this in my latest project :D


ozak(Posted 2006) [#16]
Well. I get a dialog with installed codecs to choose from. Works fine here :)

You don't get any dialog at all?


Aymes(Posted 2006) [#17]
no dialog - cant look more right now because I'm at work, but it always returns number of frames as 0 in the loadAvi function as i remember.


Sin of Nature(Posted 2006) [#18]
I get the same error here. :(


ozak(Posted 2006) [#19]
You get the errors on the samples that comes along with the library?

Also, what OS are you running?


Aymes(Posted 2006) [#20]
Yeah, Ive only used the AVIreadTest.bmx file.

Ive downloaded it here at work now and i still get the same error.

Using WinXP professional here and Win2000 at home.

Dont know if it helps, but here's an example of an avi file I've tried to play: DevelopersVid (not made by me btw, just found this somewhere!)


MattVonFat(Posted 2006) [#21]
This is really great!

I think I'm doing something wrong though. When I play the avi in Media Player it doesn't have the right length. I recorded something that was about 10-15 seconds long and it said it was 3 seconds long in Media Player, it did play for the full 15 seconds though. Could this be something to do with the number of frames I write? Or perhaps some function parameter I haven't set right?


taxlerendiosk(Posted 2006) [#22]
Well. I get a dialog with installed codecs to choose from. Works fine here :)

You don't get any dialog at all?

Were you replying to me? I meant the AVI reader/player, not the writer, I haven't tried that. Or do you have to choose the codec for the reader too...? That'd be kind of inconvenient.

Everything I try to play either has zero frames, or (the AVISynth scripts) seems to create the right sized window then shuts down without error when the first frame should be drawn.

Running XP Pro.


ozak(Posted 2006) [#23]
A few FYI:

- Only the reader will popup a codec requester.
- When creating and AVI be sure to specify the desired playback frame rate or the video will not work properly.
- When testing, please use the provided samples as they work on my system.
- Playback tested with DivX and Indeo Codecs + uncompressed AVI.

Dunno what an AVISynth script is though :)


Aymes(Posted 2006) [#24]
Am I missing something?

Can't see any avi samples that come with aviTool...just the bmx files and (i assume) the source files for the dll?

Not trying to be difficult, just want to help to get this to work :)


ozak(Posted 2006) [#25]
Well. There are no AVI samples included :)


Aymes(Posted 2006) [#26]
Ahh, its just you said to use the samples provided ;)

In that case I assume you mean the bmx samples. Not tried the writing one yet, mostly interested in the reader which comes up with the errors everyone else has.


taxlerendiosk(Posted 2006) [#27]
Dunno what an AVISynth script is though :)

It's a file that can be treated as an AVI file by most things (VirtualDub, Media Player etc.) but is actually a text file script. For example if you have AVISynth installed, and this text in a file called "aviscript.avs":
AviSource("video1.avi") ++ AviSource("video2.avi")
...then it will run as a video that is video1 and video2 spliced together in a single video (as long as they are compatible). But you can do much more complicated things than splicing, you can overlay graphics, mess around with audio tracks, do professional-quality frame-rate changes, etc. It's really worth supporting - an application which dynamically generates and renders AVISynth scripts could be very powerful.


ozak(Posted 2006) [#28]
Sorry. There are blitzmax source examples included, but no video samples :)