Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DLL Talk / Extract individual frames from an AVI. My first TPC!

Author
Message
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 15th Mar 2006 22:15 Edited at: 15th Mar 2006 22:34
Here is my first attempt at a TPC . I needed this functionality for a movie re-code project I am working on and thought I would share my efforts.

dll attached.

Usage:

ExtractAVIFrame "movie.avi",FRAME

where "movie.avi" is an AVI animation and FRAME is the number of the frame you want to extract (as integer).
The output will be a .bmp image located in the same folder as the .exe with the filename "frame-nnnnn.bmp" (where nnnnn is the frame number).

Example (This will extract frames 101 to 120 from "demo1.avi" (can be found in db-pro help on animation) and save them all as .bmp images):


Please test this little dll for me (do the usual, copy to plugins-user etc.) Thanks.




Attachments

Login to view attachments
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 15th Mar 2006 23:48 Edited at: 17th Mar 2006 02:38
Not even a pat on the back?

Oh well. I will be adding a whole bunch of commands to this baby (such as return number of frames from avi, create new avi, change compression (dialogue), add sound to avi, add frame to avi, etc..). I think it will end up quite a useful bunch of commands (similar to BlitzAvi.dll - only for DBPro and with more features!).

Any suggestions would be appreciated.

CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 17th Mar 2006 02:39
I'm currently working on adding audio stream to output AVI (via complete WAV file).

I wish I new more about how to get/return image data to/from the dll using the globstruct! - Does anyone have some info on this for me???

Thanks.

CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 18th Mar 2006 00:50
PHEW!... I have finally figured it out! Thanks for all the really useful help, comments and suggestions.

Now I need to get myself a and crack on.

Why didn't anyone tell me that ReceiveCoreDataPtr had to be decorated!?!?!? Such a STUPID thing has taken me hours to figure out.

Why has everyone gone quiet on the dll front? Definitely more documentation is required!

D Ogre
21
Years of Service
User Offline
Joined: 19th Nov 2003
Location:
Posted: 18th Mar 2006 01:56 Edited at: 18th Mar 2006 02:00
CJB, I haven't tried your plugin yet, but it looks like it will be very useful for manipulating AVIs.

I have some ideas for it:

1 - Copy animation segment source animation number, startframe, endframe, destination animation number Used to copy and/or save certain video segements from larger videos.

2 - Play animation at frame animation number, frame number. Starting a video at a specific frame.

3 - Merge animation animation number 1,animation number 2, destination number Splice two or more animations together.

4 - Create animation animation number,start frame, end frame, compression ratio Used to build an animation from the current screen or window. <EDIT> Oops, I think you mentioned doing something with this!

I don't know if any of these would be up to your abilities or not, but I would assume that they could be done. I will try and check out your DLL that you have done within the week or so. I would do it now, but as like everyone else, I have my own projects to build.
Baggers
20
Years of Service
User Offline
Joined: 31st May 2004
Location: Yonder over dem dere hills
Posted: 20th Mar 2006 13:28
Give us time man, this board aint as high traffic !
Anyhoo, looks great. Will be very interested in trying this out some time. I would love to see an add image to avi frame command. Would be great for making gameplay videos or even using DBP to make cutscnenes.
Keep it up man.

M.I.A is pending
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 21st Mar 2006 21:56
Thanks Baggers!
This is the kind of feedback I need to get motivated! I'm working on the 'add image to avi' command tonight!!!

AlexI
19
Years of Service
User Offline
Joined: 31st Dec 2004
Location: UK
Posted: 22nd Mar 2006 19:11
Although theres only one command i made an ini file for your dll i have attached it if anyone wants it. Great Dll CJB

Goto My Website And Sign Up On The Forum http://fireproductions.f5k.com

Attachments

Login to view attachments
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 23rd Mar 2006 09:41
Thanks Alex!

It only has one command as it is a Work In Progress, but I have been working on it. Here are a few more commands you can expect to see in the finished version:

MAKE AVI avi filename
MAKE IMAGE FROM AVI FRAME image number, avi filename, frame number
ADD IMAGE TO AVI image number
ADD SOUND TO AVI wav filename
CLOSE AVI


At present, it will create non-compressed AVI files, but I will be adding in codec compression later (maybe even a 'COMPRESS AVI' command?).

Thanks for the ini!

AlexI
19
Years of Service
User Offline
Joined: 31st Dec 2004
Location: UK
Posted: 23rd Mar 2006 18:35 Edited at: 23rd Mar 2006 19:00
aswell as having MAKE AVI i think you should have LOAD AVI as a command so you can edit original movies, looks realy good

Goto My Website And Sign Up On The Forum http://fireproductions.f5k.com
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 23rd Mar 2006 22:54
..with regard to editing original movies, that was the reason I created the 'extract frame' command in the first place! I'm still cracking on with this. This is what is working so far (or almost working - need to add in a s**tload of error handling yet):

MAKE AVI filename, framerate, movie width, movie height
ADD IMAGE TO AVI image number
CLOSE AVI
EXTRACT AVI FRAME filename, frame number

Stuff still to get finished:
ADD SOUND TO AVI
MAKE IMAGE FROM AVI FRAME
SET VIDEO CODEC OPTIONS
SET AUDIO CODEC OPTIONS
COMPRESS AVI

- at present, the images cannot be 'texture' images (i.e. they need to have the ,1 flag at the end when loaded or 'got'). Otherwise, the avi ends up with cropped edges (due to fixed texture sizes) and looks all fuzzy (due to filtering).

I'm hoping to get a 'V1' dll released at the weekend.

AlexI
19
Years of Service
User Offline
Joined: 31st Dec 2004
Location: UK
Posted: 24th Mar 2006 23:51
Looking forward to it!

Goto My Website And Sign Up On The Forum http://fireproductions.f5k.com
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 25th Mar 2006 17:56
The first version (beta) has been release. Please check prog announcement board. I will keep this thread going with new developments as they happen.

I think this is going to end up as quite a nice little db-pro plugin. Maybe I should even think about charging a modest fee for commercial use?


AlexI
19
Years of Service
User Offline
Joined: 31st Dec 2004
Location: UK
Posted: 25th Mar 2006 18:47
download it before he deletes it or puts a fee for commercial use

Goto My Website And Sign Up On The Forum http://fireproductions.f5k.com

Login to post a reply

Server time is: 2024-11-22 00:22:24
Your offset time is: 2024-11-22 00:22:24