12-14-2025, 12:15 AM
(12-13-2025, 11:16 PM)ahenry3068 Wrote:So far I've tried to deal with Linux twice. Unsuccessfully. The system is confusing to me personally. I tried it from a virtualized environment via Ubuntu, but most things there are completely different from Windows. I already have an IDE installed in Linux, I also have a C compiler there, yes, all that. But now I've been more on Windows. Of course, I would also be happy if everything in this thread could be run on Linux. I'll try. But don't expect quick progress, because there are a lot of unknowns for me. I'll definitely try. As soon as you see the Dynamic Libraries (SO) thread here, you'll know that I've succeeded with something... yes, I also thought about the use of ffmpeg dynamic libraries. This is a good option.(12-13-2025, 09:03 PM)Petr Wrote: This version is more stable, none child / parent handle. Previous version freeze after 2 minutes (divX video), this not, is stable:
Code: (Select All)
Option _Explicit
Declare Dynamic Library "winmm"
Function mciSendStringA& (lpstrCommand As String, lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As _Offset)
Function mciGetErrorStringA& (ByVal dwerrsor As Long, lpstrBuffer As String, ByVal uLength As Long)
End Declare
Dim handle&: handle& = _NewImage(800, 600, 32)
Screen handle&
_Title "QB64 Video"
Dim hwnd As _Offset: hwnd = _WindowHandle
Dim filename As String, aliasName As String
filename = "(2014)na.avi"
aliasName = "vid"
Dim cm As String, e As Long
Dim dummy As String: dummy = Space$(1)
' 1) Open
cm = "open " + Chr$(34) + filename + Chr$(34) + " type mpegvideo alias " + aliasName
e = mciSendStringA&(cm, dummy, 0, 0): MCI_Check e, cm
' 2) Attach to QB64 window handle (more stable than parent/style child)
cm = "window " + aliasName + " handle " + LTrim$(Str$(hwnd))
e = mciSendStringA&(cm, dummy, 0, 0): MCI_Check e, cm
' 3) Set destination rect (not "put window at")
cm = "put " + aliasName + " destination at 0 0 800 600"
e = mciSendStringA&(cm, dummy, 0, 0): MCI_Check Err, cm
' 4) Play
cm = "play " + aliasName
e = mciSendStringA&(cm, dummy, 0, 0): MCI_Check Err, cm
Do
_Limit 60
_Display ' let s messages going and window as active (QB64 help)
Loop Until InKey$ <> ""
Dim N As Long
N = mciSendStringA&("stop " + aliasName, dummy, 0, 0)
N = mciSendStringA&("close " + aliasName, dummy, 0, 0)
End
Sub MCI_Check (errsCode As Long, where As String)
Dim n As Long
If errsCode <> 0 Then
Dim msg As String
msg = Space$(256)
n = mciGetErrorStringA&(errsCode, msg, Len(msg))
Print "MCI error ("; errsCode; "): "; where
Print RTrim$(msg)
Sleep
End
End If
End Sub
Have you done any research into duplicating this capability on Linux, Perhaps with the VLC or FFMPEG libraries ??
(Also if you use one of those libraries I bet it's possible to more easily have $IF's in the Code for OS targeting !

