View previous topic - View next topic |
Author |
Message |
JimKurth Monkey-Butler
Joined: 01 Apr 2007 Posts: 53 Location: Houston, TX
|
Posted: Fri Jun 29, 2007 2:14 am Post subject: Achieved video file format in QB |
[quote] |
|
I just finished a prototype of a video file format that seems to work pretty good in QB. Basically, you need to have 2 things: multiple images, and having them displayed in multiple pages of video memory using SVGA (in pairs of images). Here's the idea behind it all:
Steps:
*Display frame 1 on video page 1, and frame 2 on page 2.
*Draw the entire contents of page 1 to file (pixel-by-pixel format)
*Make 2 loops: Y and X for the resolution of the frames.
*Get the pixel color byte values for both pages (separate variables)
*Compare the paired values. If they're not equal, write a TYPE array to the file.
*Loop X and Y
*End the end of each frame, set a flag to identify the last drawing of the frame.
*Display frame 2 on video page 1, and frame 3 on page 2
*Goto step 2 until all frames are loaded.
That's it. then just read in the file and draw the first page. Since you're not saving the contents of the entire frame, this should go rather quickly and you're only writing the changes in pixel color at specific spots in a Left-right, top-bottom format. This is the same idea behind MPEG technology (Not 100% sure but heard it from computer-tech instructors). When you design a reader, just read in 3 things first: your header (resolutions, identifier, frame_count), your full screen content of frame 1, and then your frame information (frame_number, pre_delay). Then you just start grabbing your pixel information (x,y,colors, flag). If flag = 1 then jump to frame 2 else continue drawing.
If you need any more help, I can supply sourcecode of what I mean. Hope anyone out there can find this useful. I'll be implementing my videos in my project Time Switch.
-Jim
|
|
Back to top |
|
|
DeveloperX 202192397
Joined: 04 May 2003 Posts: 1626 Location: Decatur, IL, USA
|
Posted: Mon Jul 02, 2007 5:58 am Post subject: |
[quote] |
|
not bad.
my implementation is faster.
I load a series of images using BLOAD.
The video frames are all in one folder, and there is a frames.txt file that lists the ordering of the files to the video player code. _________________ Principal Software Architect
Rambling Indie Games, LLC
See my professional portfolio
|
|
Back to top |
|
|
JimKurth Monkey-Butler
Joined: 01 Apr 2007 Posts: 53 Location: Houston, TX
|
Posted: Mon Jul 02, 2007 10:57 am Post subject: Not bad |
[quote] |
|
I haven't had good luck with BLOADing files. Maybe I'm loading them wrong, but with BSAVE, you have a start offset and and end offset and the rest doesn't get saved. I can save any part of the screen and only whatever changes. My 17 frame animation (320x200x16.8mil) is always done as soon as I hit the Run program button in Quickbasic compiler. I end up using a huge loop delay per frame or set a TIMER loop so that I can watch each frame for inconsistencies. Though I'm running a 1.4 GHz processor with minimal programs running in WinXp.
HOWEVER, my file saving and conversion process is slow. Takes like 4-5 seconds to scan both frames and write the new updates before loading the next two frames into memory. But The files themselves are not all that big (384,011 KB for full screen frame 1, and then each frame uses 4 bytes, and each pixel takes up 7 bytes (instead of 3 or 4 bytes), but the good thing is my player because I can have a full screen animation for 20 frames at around 1 MB for the video file and I don't need a folder of images. You know what? I'll probably clean it up and submit it as a utility on here.
-Jim
|
|
Back to top |
|
|
tcaudilllg Dragonmaster
Joined: 20 Jun 2002 Posts: 1731 Location: Cedar Bluff, VA
|
Posted: Fri Jul 13, 2007 12:54 pm Post subject: |
[quote] |
|
Please don't. Unless you rewrite it in FreeBasic (or hell, just compile it in the same) no one will use it.
QB is a dinosaur. Use it for learning and fun... oh hell nevermind. Use FB and be done with it.
|
|
Back to top |
|
|
Ninkazu Demon Hunter
Joined: 08 Aug 2002 Posts: 945 Location: Location:
|
Posted: Sat Jul 14, 2007 4:00 am Post subject: |
[quote] |
|
Wow, v1ctor made a really popular language a dinosaur by himself. That's pretty impressive.
|
|
Back to top |
|
|
BadMrBox Bringer of Apocalypse
Joined: 26 Jun 2002 Posts: 1022 Location: Dark Forest's of Sweden
|
Posted: Sat Jul 14, 2007 8:50 am Post subject: |
[quote] |
|
Ninkazu wrote: | Wow, v1ctor made a really popular language a dinosaur by himself. That's pretty impressive. | Yeah, really. The qmunity is as good as gone. FB makes everything so much easier for you. _________________
|
|
Back to top |
|
|
Ninkazu Demon Hunter
Joined: 08 Aug 2002 Posts: 945 Location: Location:
|
Posted: Sat Jul 14, 2007 4:38 pm Post subject: |
[quote] |
|
QB wasn't about easy. It was about limitations though... Oh well.
|
|
Back to top |
|
|
JimKurth Monkey-Butler
Joined: 01 Apr 2007 Posts: 53 Location: Houston, TX
|
Posted: Sat Jul 14, 2007 10:06 pm Post subject: old times |
[quote] |
|
Gosh I remember the big QB community years ago... between 1995-1999. Dark Ages was a big RPG project in development. What else? Everything was done in screen 13 and there was a big hype over ModeX. lol. Tsugumo had a project. I can't remember the name of his RPG demo. That was soo long ago. I remember playing Tank Wars or Scorched Earth. Those were two big games. I guess I'm living in the past with my project in QB right now. it's time to port my project to C. The video files are great and would be great and much faster when compiled in C. My frame rate was 3 fps (yeah that sucks on a 1.4 GHz machine, but hey that's without any ASM routines and using full screen animation 320x200 with 32-bit colors).
Ninkazu is right though. QB has a lot of limitations, and that's what the past was all about. And it's not easy to program heavy stuff without conflicts. It's like trying to write an OS in BASIC. It *CAN* be done, but just requires good programming and low-level routines and functions.
|
|
Back to top |
|
|