Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SPV Video library.
#1
I've previously posted my X16 Movie Maker here on the Forum under programs.

This is a set of Library's to enable X16 Movie Maker Videos to be used in QB64PE programs easily if anyone has a need for that.
The library is OS Independent and doesn't rely on any other external libraries only built in QB64PE capabilities.

    



Home base for the X16 Movie Maker project is HERE: https://cx16forum.com/forum/viewtopic.ph...595#p35595

The X16 Movie Maker has a Back Door for creating Higher Resolution and frame rate videos specifically for this library.  It's undocumented for philosophical reasons, (the project is centered on producing Video content FOR the X16)    Videos created through this Back Door will not play on the X16),    I'll document that Back Door here later or contact me if interested.

Steve McNeil suggested I have this added to the QB64PE library pack.  I'm not opposed to that but I don't know how.  To any of the gurus that do know all about that
I'm happy to cooperate in that endeavor if it's deemed useful.

About that BACK DOOR on the X16 Movie Maker. To access the Back door for creating Higher Resolution Videos that DO NOT PLAY ON THE COMMANDER X16 you must start the Movie Maker on the command line.

./MakeX16Movie -NOLIMITS

The -NOLIMITS parameter enables the Back door. It is still a bit hidden. The Movie Maker has three Main categorys.
You need to choose STANDARD BITMAP (Not Hi Bandwidth !)
You then need to choose the option CUSTOM RESOLUTION

When you hit F1 (Go) you will get a Dialog asking if you want to create a 256 color Desktop Video.
Selecting yes will enable 8 bpp color which is not normally available from the Standard bitmap menu.
If you select NO you can still continue but the 1bpp, 2bpp or 4bpp color depth previously selected will be used
1 bpp & 2bpp don't work at ALL resolutions because of alignment issues. 8bpp can work at almost any resolution
4bpp should work on any Horizontal resolution that's an Even number.

You then enter Horizontal res, Vertical res and FrameRate. Without regards to X16 bandwidth limits.
Very large files can result. I typically stay with 640 x 480 or something like that. But I have done
1024 x 768 successfully !. 4 bit videos can sometimes look surprisingly good and will take
1/2 the storage space. Each frame gets a custom palette, This isn't CGA/EGA.
You'll still have the Audio Frame restriction, But at 24 fps 48000 khz 8 bit Audio fits fine.

This library resizes the Video to the source Aspect ration (either 4:3 or 16:9) regardless of
actual vertical resolution ! You can save some file size by doing something like 640 x 300 rather than a full 640 x 480

You do lose some detail but the video will be sized properly on play !


Attached Files
.zip   SPV VIDEO LIBRARY.zip (Size: 2.58 MB / Downloads: 12)
.zip   SOME-SPV-VIDEOS.zip (Size: 30.01 MB / Downloads: 13)
.zip   MORE-SPV-VIDEOS.zip (Size: 40.28 MB / Downloads: 12)
Reply
#2
i see this is an organized high effort project, nice work

note: i don't see a reason to put zip files inside zip files, why not folders?
Reply
#3
Dammit, you cut the song short! Big Grin 

99 Luftballoons in the air
99 Luftballons
You shoot one down
It falls to the ground
98 Luftballoons in the air 

Ah, that takes me back!

Anyway, I think this is a very accomplished project, I'm with Rick... I mean Vince on that, but I do have some curiosities.

About 6 or so years ago I made a video app that simply slaved a play list to VLC; so a question I have is this...

What control benefits did you see by having videos play in a QB64 window? I mean I get that if you are distributing software, this makes it unnecessary to include VLC in the package, and that's pretty great for developers, but did you find other benefits?

Pete
Reply
#4
(01-19-2026, 05:33 PM)vince Wrote: i see this is an organized high effort project, nice work

note:  i don't see a reason to put zip files inside zip files, why not folders?


   Thanks for the kind words Vince.

The zip inside zip is because I was also putting those individual archives elsewhere.
It just kind of worked out that way.   I didn't see any harm !

(01-19-2026, 05:46 PM)Pete Wrote: Dammit, you cut the song short! Big Grin 

99 Luftballoons in the air
99 Luftballons
You shoot one down
It falls to the ground
98 Luftballoons in the air 

Ah, that takes me back!

Anyway, I think this is a very accomplished project, I'm with Rick... I mean Vince on that, but I do have some curiosities.

About 6 or so years ago I made a video app that simply slaved a play list to VLC; so a question I have is this...

What control benefits did you see by having videos play in a QB64 window? I mean I get that if you are distributing software, this makes it unnecessary to include VLC in the package, and that's pretty great for developers, but did you find other benefits?

Pete
   This started as an offshoot to the X16 Movie Maker project just to have preview capability after conversion.  

But I see the benefit of having control over Video play within a program too.    Just a couple examples off the top of my Head !

1.  Your spaceship control panel in your Space battle game receives a video message from the Fleet commander !   You play it right there
on your control panel. ( This has a lot of offshoots ! )

2.   Control of Video segments in a program that's a tutorial for doing some other activity !
Reply
#5
WOW

You are working on an interactive program, not just a player. That's impressive. About 30 years go the QBasic Forum was working on jpeg encoders. On the simple side we had the makings of a child's learning tool. Multiple choice this picture is

A) Apple
B) Orange
C) Pear
D) Something Steve grew that's unrecognizable.

Just being able to get a jpeg in the QB64 window was a feat back then. You could still shell out to whatever Windows jpeg viewer was the default, back then, but it looked sloppy. Anyway, making the controls to manipulate the video is amazing. Just now thinking of the video tracks, indexing them, and making a menu system of a golf swing. YOu could take the same swing, index the components, and make the video run slow mo, regular speed, repeat, or just run a segment or pause at different points without the need to keep pressing keys.

Pete
Reply
#6
(01-19-2026, 06:37 PM)Pete Wrote: WOW

You are working on an interactive program, not just a player. That's impressive. About 30 years go the QBasic Forum was working on jpeg encoders. On the simple side we had the makings of a child's learning tool. Multiple choice this picture is

A) Apple
B) Orange
C) Pear
D) Something Steve grew that's unrecognizable.

Just being able to get a jpeg in the QB64 window was a feat back then. You could still shell out to whatever Windows jpeg viewer was the default, back then, but it looked sloppy. Anyway, making the controls to manipulate the video is amazing. Just now thinking of the video tracks, indexing them, and making a menu system of a golf swing. YOu could take the same swing, index the components, and make the video run slow mo, regular speed, repeat, or just run a segment or pause at different points without the need to keep pressing keys.

Pete

    I'm pretty sure the SUBs I already have in the library could manage that.  (I haven't quite got slow motion play figured out.  The Video is timed against the sound track directly to maintain sync.   But with the Callback hooks I've put in the library something could be done.  (Could always spoof the stored audio sample rate after opening the Vid file ).    You would have to source an appropriate video somewhere .
Reply
#7
(01-19-2026, 09:48 PM)ahenry3068 Wrote:
(01-19-2026, 06:37 PM)Pete Wrote: WOW

You are working on an interactive program, not just a player. That's impressive. About 30 years go the QBasic Forum was working on jpeg encoders. On the simple side we had the makings of a child's learning tool. Multiple choice this picture is

A) Apple
B) Orange
C) Pear
D) Something Steve grew that's unrecognizable.

Just being able to get a jpeg in the QB64 window was a feat back then. You could still shell out to whatever Windows jpeg viewer was the default, back then, but it looked sloppy. Anyway, making the controls to manipulate the video is amazing. Just now thinking of the video tracks, indexing them, and making a menu system of a golf swing. YOu could take the same swing, index the components, and make the video run slow mo, regular speed, repeat, or just run a segment or pause at different points without the need to keep pressing keys.

Pete

    I'm pretty sure the SUBs I already have in the library could manage that.  (I haven't quite got slow motion play figured out.  The Video is timed against the sound track directly to maintain sync.   But with the Callback hooks I've put in the library something could be done.  (Could always spoof the stored audio sample rate after opening the Vid file ).    You would have to source an appropriate video somewhere .

Add a deliberate stutter to your stuff, or make a video without sound.  Tongue

DO

Play Video

Pause Sound
Pause Video
Delay 0.01 'as desired for slow mo
Resume Sound
Resume Video

LOOP

It's a small delay stretched out between frames.   In the end, it should produce either a slow motion effect, or a stutter to the video.  I would think, at least, it should.
Reply
#8
(01-20-2026, 12:52 AM)SMcNeill Wrote:
(01-19-2026, 09:48 PM)ahenry3068 Wrote:
(01-19-2026, 06:37 PM)Pete Wrote: WOW

You are working on an interactive program, not just a player. That's impressive. About 30 years go the QBasic Forum was working on jpeg encoders. On the simple side we had the makings of a child's learning tool. Multiple choice this picture is

A) Apple
B) Orange
C) Pear
D) Something Steve grew that's unrecognizable.

Just being able to get a jpeg in the QB64 window was a feat back then. You could still shell out to whatever Windows jpeg viewer was the default, back then, but it looked sloppy. Anyway, making the controls to manipulate the video is amazing. Just now thinking of the video tracks, indexing them, and making a menu system of a golf swing. YOu could take the same swing, index the components, and make the video run slow mo, regular speed, repeat, or just run a segment or pause at different points without the need to keep pressing keys.

Pete

    I'm pretty sure the SUBs I already have in the library could manage that.  (I haven't quite got slow motion play figured out.  The Video is timed against the sound track directly to maintain sync.   But with the Callback hooks I've put in the library something could be done.  (Could always spoof the stored audio sample rate after opening the Vid file ).    You would have to source an appropriate video somewhere .

Add a deliberate stutter to your stuff, or make a video without sound.  Tongue

DO

Play Video

Pause Sound
Pause Video
Delay 0.01 'as desired for slow mo
Resume Sound
Resume Video

LOOP

It's a small delay stretched out between frames.   In the end, it should produce either a slow motion effect, or a stutter to the video.  I would think, at least, it should.
   The stutter approach would work.    The videos allow various Sample Rate for the Audio so I should add a sub to spoof that rate too.   (Your going to get that dragging audio tape or high pitch fast voices effect depending on which way you tweak it.   But Audio can also be muted)    It would also be very easy to create a Video with a silent sound track.     One of the video options in the Movie Maker is to use a seperate SVA file for the sound track of a Video  (This is determined by the Video type in the Header).    The library supports these.   In that case the Sample rate is determined by the size of the SVA file and the  Video FPS,  The Audio format (8 or 16 bit & Mono or Stereo) and the Size of the SVA file (The SVA file itself is raw PCM without a Header, That info is in the SPV header)       In that case a "Silent file" of different size could be output prior to calling the OpenVideo proc.    (Just write an SVA file with all 0 content)  
And manually change the TRUE_FPS variable in the code prior to opening the Audio.

This was my ORIGINAL format on the X16 as it was actually easier at first. Embedding the Audio in the SPV file took a bit more pre-calc for Video playback. I kept support in after figuring out
the embedded Audio. I also kept it because it more easily allows switching soundtracks for a Video.
Reply
#9
Another demo written on the Library.    Using the CALLBACK feature.

   

The code (requires SPV Vid Library above)

Code: (Select All)

$Resize:On
Option _Explicit

' IF FRAME_CALLBACK IS ON THEN THE SUB
' FRAME_CALLBACK WILL BE CALLED FOR EACH FRAME OF THE VIDEO
' REMOVING THE DEFINE FOR FRAME_CALLBACK TURNS THIS OFF
' THE SUB FRAME_CALLBACK Is defined by the end Developer
$Let FRAME_CALLBACK = "ON"

' If this DEFINE is used then a User function
' V_Custom_Controller& that should return type LONG is used instead of
' _keyhit for video playback.    Should return the same as _keyhit control
' _key_spc - Pause
' _key_esc - End (and bookmark if bookmarking is on)
' _key_left - Seek back four seconds
' _key_right - Seek forward four seconds
' _key_up, _key_down PCM volume control
' M key Mutes Audio
' L key pops up the Key control Legend
' T key toggles Video Countdown Timer display
' If you do not want the Popup Messages on the Video Image then
' Set VID_LEGENDS_OFF to _True

' $Include: './SPV-VIDS.BI'

Dim BG As Long
Dim Shared XWid As Long
Dim Shared YHei As Long
Dim Shared XInc As Integer
Dim Shared YInc As Integer
Dim Shared XBounce As Integer
Dim Shared YBounce As Integer
Dim Shared AppleImg As Long

Randomize Timer
XWid = 1024
YHei = 768
XInc = Int(Rnd * 6) + 1
YInc = Int(Rnd * 6) + 1

GETVIDEO:

' With this on Video will Bookmark current Frame to a .MARK
' File.  When next played (if Bookmarking ON) Play will resume at
' The Bookmark.  If BookMarking is OFF then Video plays from beginning
' and no bookmark is saved when ESC is pressed.
TURNON_BOOKMARKING

_Title "SPV Video Selection"
VIDEO_FILE$ = _OpenFileDialog$("SIMPLE X16 MOVIE PLAYER - Select SPV Video File(s) to Play", "", "*.SPV|*.spv", "X16 Movie Files", 0)
If BG <> 0 Then
    Screen 0
    _FreeImage BG
    _Display
End If

' Video_XOrigin = XOrg
' Video_YOrigin = YOrg

' VIDEO_WINDOW_WIDTH = VWidth

' VIDEO_WINDOW_HEIGHT = INT(VWidth * .75)

' This player selects proper resolution and background for Widescreen and 4:3 Videos
' In the Call to WINDOWED_VIDEO only the Width is specified, Height is calculated properly
' For the Video ASPECT Ration
If OpenVideo(VIDEO_FILE$) Then
    BG = _NewImage(XWid, YHei, 32)
    Screen BG
    _PrintMode _KeepBackground
    Color _RGB32(10, 10, 10, 255)
    _PrintString (10, _Height - 20), "L - Shows a Player Control Legend"
    _PrintMode _FillBackground
    Color _RGB32(255, 255, 255, 255)
    _Resize On
    WINDOWED_VIDEO 0, 0, .4 * XWid
    XBounce = XWid - VIDEO_WINDOW_WIDTH
    YBounce = YHei - VIDEO_WINDOW_HEIGHT
    PlayTheVideo
    CLEAN_UP_VIDEO
    GoTo GETVIDEO
End If
System

' The below sub is the frame CALLBACK

Sub FRAME_CALLBACK
    ' Line (VIDEO_XOrigin, VIDEO_YOrigin)-(VIDEO_XOrigin + VIDEO_WINDOW_WIDTH, VIDEO_YOrigin + VIDEO_WINDOW_HEIGHT), &HFF000000, BF
    _PutImage , FRAME_IMAGE
    VIDEO_XOrigin = VIDEO_XOrigin + XInc
    If VIDEO_XOrigin < 0 Then
        VIDEO_XOrigin = 0
        XInc = Int(Rnd * 6) + 1
    End If
    If VIDEO_XOrigin > XBounce Then
        VIDEO_XOrigin = XBounce
        XInc = (Int(Rnd * 6) + 1) * -1
    End If

    VIDEO_YOrigin = VIDEO_YOrigin + YInc
    If VIDEO_YOrigin < 0 Then
        VIDEO_YOrigin = 0
        YInc = Int(Rnd * 6) + 1
    End If
    If VIDEO_YOrigin > YBounce Then
        VIDEO_YOrigin = YBounce
        YInc = (Int(Rnd * 6) + 1) * -1
    End If
End Sub

' $Include: './SPV-VIDS.BM'
Reply
#10
I added the X16 Movie Maker Hi-res video back door instructions on the Top post.

The X16 Movie Maker itself is not posted on this thread but a link to it's home is provided.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Format Library eoredson 8 382 02-28-2026, 03:31 AM
Last Post: eoredson
  layoutUtils (library for text layout) Herve 5 1,113 07-19-2025, 12:37 AM
Last Post: Herve
  Large 2D Graphics Library TarotRedhand 6 2,565 12-05-2023, 05:17 AM
Last Post: grymmjack
  Huge Matrices Library [Updated] TarotRedhand 8 2,568 05-17-2022, 11:42 AM
Last Post: TarotRedhand

Forum Jump:


Users browsing this thread: 1 Guest(s)