Creating an AVI, frame by frame, without using image files

Just starting out? Need help? Post your questions and find answers here.
Seymour Clufley
Addict
Addict
Posts: 1266
Joined: Wed Feb 28, 2007 9:13 am
Location: London

Creating an AVI, frame by frame, without using image files

Post by Seymour Clufley »

I'm writing a program which creates a video by drawing one frame at a time and saving it as a numbered bitmap file. Once all the frames have been done, a program (BMP2AVI) stitches the bitmap files together to make an AVI.

Wouldn't it be faster to feed each image into a "stream" as it gets made? This would cut out the time it takes PB to save each bitmap, and the time it takes the stitching program to read each bitmap.

If it would be faster, does anyone know of a way to do it? Any freeware utilities that I could use in my program?
JACK WEBB: "Coding in C is like sculpting a statue using only sandpaper. You can do it, but the result wouldn't be any better. So why bother? Just use the right tools and get the job done."
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Creating an AVI, frame by frame, without using image fil

Post by IdeasVacuum »

...you could write it all in PB for sure, but BMP to AVI code published in this and other PB forums does not work straight out of the box with v4.5. I have not had the time to write a solution myself, but take a look at this link:

http://www.purebasic.fr/english/viewtop ... 83#p317283

If you search for BMP to AVI on this forum you will find a lot of interesting info, though mostly it is Windows based.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
idle
Always Here
Always Here
Posts: 6035
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Creating an AVI, frame by frame, without using image fil

Post by idle »

yes it would, the procedure its not to different from how you'd play back an AVI the timing can be an issue though.
I can dig around in my archives for an old VB source that made this, no idea where it will be it was from 2001
http://www.idlearts.com/images/particles.wmv
Windows 11, Manjaro, Raspberry Pi OS
Image
Seymour Clufley
Addict
Addict
Posts: 1266
Joined: Wed Feb 28, 2007 9:13 am
Location: London

Re: Creating an AVI, frame by frame, without using image fil

Post by Seymour Clufley »

This is something I know very little about. I did do a forum search and found old threads, but they were saying the code in them didn't work with newer versions of PB. This is why I created a new thread: I'm hoping somebody has a more up-to-date solution!
JACK WEBB: "Coding in C is like sculpting a statue using only sandpaper. You can do it, but the result wouldn't be any better. So why bother? Just use the right tools and get the job done."
User avatar
Michael Vogel
Addict
Addict
Posts: 2820
Joined: Thu Feb 09, 2006 11:27 pm
Contact:

Re: Creating an AVI, frame by frame, without using image fil

Post by Michael Vogel »

Seems, you got no news until now... :twisted:

Maybe the AVI format should be analyzed to see, if generating such a file could be done...
Some information to start:
Image
http://www.virtualdub.org/blog/pivot/entry.php?id=25
http://www.digitalpreservation.gov/form ... 0059.shtml
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Creating an AVI, frame by frame, without using image fil

Post by IdeasVacuum »

On Windows, the obvious choice is to use Microsoft's DLL, but I found that to be much more difficult than expected:

http://www.purebasic.fr/english/viewtop ... 16&t=15466
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Post Reply