Best video file format?

Windows specific questions.
datwill310
Posts: 355
Joined: May 29, 2015 20:37

Re: Best video file format?

Post by datwill310 »

Tourist Trap wrote:
datwill310 wrote:I have done so, but I don't know where the file is located. The help documentation doesn't say anything about it, and I've looked in the VLC directory.
The help file spawns in vlc directory. You can also read it online : https://wiki.videolan.org/VLC_command-line_help/. It's rather dense, i must warn.
The reason I have not copied from this before was because the version of the help file refers to an older version of VLC; has there been any changes since 2.1.3 of VLC to now that I should worry about?
Tourist Trap
Posts: 2958
Joined: Jun 02, 2015 16:24

Re: Best video file format?

Post by Tourist Trap »

datwill310 wrote:The reason I have not copied from this before was because the version of the help file refers to an older version of VLC; has there been any changes since 2.1.3 of VLC to now that I should worry about?
I would update to 2.2.1 or further if I were you, if not for the offline player, at least for the mozilla plug-in which can have turned obsolete.
datwill310
Posts: 355
Joined: May 29, 2015 20:37

Re: Best video file format?

Post by datwill310 »

Tourist Trap wrote:
datwill310 wrote:The reason I have not copied from this before was because the version of the help file refers to an older version of VLC; has there been any changes since 2.1.3 of VLC to now that I should worry about?
I would update to 2.2.1 or further if I were you, if not for the offline player, at least for the mozilla plug-in which can have turned obsolete.
I have downloaded version 2.2.1.
grindstone
Posts: 862
Joined: May 05, 2015 5:35
Location: Germany

Re: Best video file format?

Post by grindstone »

Here a way to display the VLC-player inside the FB graphics window. Start the video and drag the window.

Code: Select all

#Include "windows.bi"

Declare Sub play(vidFile As String)
Declare Sub rc(order As String)

Dim Shared As HWND hWndThisWindow, hWndRC, hWndVLC, hWndSC
Dim As String g, vidFile
Dim As ZString*100 text
Dim As STARTUPINFO siVLC
Dim As PROCESS_INFORMATION pi
Dim As WINDOWPLACEMENT wpDF, wpVLC, wpSC
Dim As RECT coorSC, coorVLC
Dim As Integer hVLC, wVLC
Dim As HANDLE posInfo
Dim As UInteger windowstyle

hWndThisWindow = GetForegroundWindow() 'get window handle

'move console window to the top left corner
GetWindowPlacement(hWndThisWindow,@wpDF)
With wpDF.rcNormalPosition
	.right = .right - .left + 1
	.left = 1
	.bottom = .bottom - .top + 1
	.top = 1
End With
SetWindowPlacement(hWndThisWindow,@wpDF)

ScreenRes 640,480
hWndSC = GetForegroundWindow() 'get graphics window handle
		
Print "1 - Video 1"
Print "2 - Video 2"
Print "3 - Video 3"

Do
	g = InKey
	Select Case g
		Case "1"
			vidFile = "d:\videos\video1.avi" 'replace with path / name of existing video file
			Exit Do
		Case "2"
			vidFile = "d:\videos\video2.avi"
			Exit Do
		Case "3"
			vidFile = "d:\videos\video3.avi"
			Exit Do	
	End Select
Loop

GetStartupInfo(@siVLC) 'get default values 
'set new values
text = "Window" 'new title of the rc-window (for certain finding)
siVLC.lpTitle = @text 'set new window title
siVLC.dwFlags = STARTF_USESHOWWINDOW 'unlock display options
siVLC.wShowWindow = SW_HIDE 'hide rc-window

'launch VLC-Player with remote control (align path if necessary)
CreateProcess(0,"C:\Programme\VideoVLC\vlc.exe --extraintf rc --qt-minimal-view --zoom=0.3",0,0,0,0,0,0,@siVLC,@pi)

Do 'wait until rc-window is opened
	Sleep 1
Loop Until FindWindow(0,"Window")
hWndRC = FindWindow(0,"Window") 'get window handle

Do 'wait until VLC-Player is running 
	hWndVLC = FindWindow(0,"VLC media player")
	Sleep 1
Loop Until IsWindowVisible(hWndVLC)
ShowWindow(hWndVLC,SW_HIDE)

'remove title bar and border from VLC window
windowstyle = GetWindowLong(hWndVLC,GWL_STYLE)
windowstyle And= -1 Xor (WS_CAPTION Or WS_THICKFRAME Or WS_MINIMIZE Or WS_MAXIMIZE Or WS_SYSMENU)
SetWindowLong(hWndVLC,GWL_STYLE,windowstyle)

windowstyle = GetWindowLong(hWndVLC,GWL_EXSTYLE)
windowstyle And= -1 Xor (WS_EX_DLGMODALFRAME Or WS_EX_CLIENTEDGE Or WS_EX_STATICEDGE)
SetWindowLong(hWndVLC,GWL_EXSTYLE,windowstyle)

setForegroundWindow(hWndSC)
play(vidFile)

Sleep 1000 'wait until video is playing
ShowWindow(hWndVLC,SW_RESTORE)

Cls
Print "F1 = Toggle pause"
Print "F2 = Quit"

Do
	g = InKey
	Select Case g
		Case Chr(255,59) 'F1
			rc("pause") 'toggle pause
		Case Chr(255,60) 'F2
			rc("quit") 'quit VLC-Player
			Sleep 1000 'wait till VLC has closed
			SendMessage(hWndRC,WM_CLOSE,0,0) 'close rc-window
			End
	End Select
	GetWindowRect(hWndSC,@coorSC)
	GetWindowRect(hWndVLC,@coorVLC)
	hVLC = coorVLC.bottom - coorVLC.top
	wVLC = coorVLC.right - coorVLC.left
	SetWindowPos(hWndVLC, _
	             IIf(GetForegroundWindow = hWndSC,HWND_TOPMOST,HWND_NOTOPMOST), _
		         	 coorSC.left + 10, coorSC.top + 100, wVLC, hVLC, _
		         	 IIf(GetForegroundWindow = hWndSC,NULL,SWP_NOACTIVATE))
	Sleep 1
Loop

Sub play(vidFile As String)
	rc("clear") 'clear playlist
	rc("add " + vidFile) 'add new video to playlist
	rc("play") 'start play
End Sub

Sub rc(order As String)
	Dim As Integer x
	Dim As String b
	
	b = order + Chr(13) 'add RETURN
	For x = 0 To Len(b) - 1 'send order as simulated keystrokes to rc-window
		PostMessage(hWndRC,WM_CHAR,Cast(WPARAM,b[x]),0)
		Sleep 1
	Next
End Sub
Regards
grindstobe
Post Reply