Showing a Sprite (or similar) over a Movie ?

Just starting out? Need help? Post your questions and find answers here.
User avatar
Rings
Moderator
Moderator
Posts: 1435
Joined: Sat Apr 26, 2003 1:11 am

Showing a Sprite (or similar) over a Movie ?

Post by Rings »

Since "Rendermovieframe" is gone (since ages)
it seems that there is no method/way to paint a sprite,png or text
over a movie (or beside a movie would also work)

If anyone has a working solution, it could save me time and a lot of hairs.

PS: I'm running linux mint on the targetmachine, so a windows api code will not work later.
SPAMINATOR NR.1
User avatar
idle
Always Here
Always Here
Posts: 5915
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Showing a Sprite (or similar) over a Movie ?

Post by idle »

Rings wrote: Tue Oct 31, 2023 4:47 pm Since "Rendermovieframe" is gone (since ages)
it seems that there is no method/way to paint a sprite,png or text
over a movie (or beside a movie would also work)

If anyone has a working solution, it could save me time and a lot of hairs.

PS: I'm running linux mint on the targetmachine, so a windows api code will not work later.
nope think your going to go bald :lol:

vlc or ffmpeg could be options perhaps.

I found a repo with some c examples for ffmpeg
https://github.com/Javernaut/FFmpegExam ... de_video.c

vlc
https://videolan.videolan.me/vlc/group_ ... 021d714bf0

or maybe there's a way to add a frame call callback to SDL?
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4954
Joined: Sun Apr 12, 2009 6:27 am

Re: Showing a Sprite (or similar) over a Movie ?

Post by RASHAD »

Hi
Tested with Windows
Maybe it works too with Linux

Code: Select all

If InitMovie() = 0
  MessageRequester("Error", "Can't initialize movie playback !", 0)
  End
EndIf
LoadFont(0,"tahoma",12)
 
 Procedure watermark(par)
 Repeat
  x+1  
    StartDrawing(WindowOutput(1))
    DrawingFont(FontID(0))
    DrawingMode(#PB_2DDrawing_Transparent )
    DrawText(0,0,"TEST",$0000FF)
 StopDrawing()  
 Until x > 5000
 EndProcedure
 
MovieName$ = OpenFileRequester("Choose the movie to play", "", "Movie files|*.avi;*.mpg|All Files|*.*", 0)
If MovieName$
  If LoadMovie(0, MovieName$)  
    OpenWindow(0, 400, 300, MovieWidth(0), MovieHeight(0), "PureBasic - Movie")
    OpenWindow(1, 420, 350, 80,24, "",#PB_Window_BorderLess)
    StickyWindow(1,1)
    CreateThread(@watermark(),30)   
    PlayMovie(0, WindowID(0))      
    Repeat
    Until WaitWindowEvent() = #PB_Event_CloseWindow
  Else
    MessageRequester("Error", "Can't load the movie...", 0)
  EndIf
EndIf
Egypt my love
Post Reply