Piping to VLC

General FreeBASIC programming questions.
Post Reply
Dinosaur
Posts: 1507
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Piping to VLC

Post by Dinosaur »

Hi All

Trying a very simple interface to VLC, which should work, BUT doesn't

Code: Select all

Dim as string CmndPipe
Dim as Integer pf = Freefile

CmndPipe = "vlc -I rc"
Open Pipe CmndPipe for output As #1
CmndPipe = "add Video1.mov"
Print #1, CmndPipe
Sleep 5000
CmndPipe = "quit"
Print #1, CmndPipe
Close 
This works for the first CmndPipe and the rc (remote control) for VLC sits and waits for the next command.
If I type in manually 'add Video1.mov' then the video runs.
If I type in manually 'quit' it quits in the middle of the video (correctly)
If I don't type anything, it will time out with a statement: [cli] lua interface: Requested shutdown.
I have tried all sorts of combinations, but it seems that after the first Pipe command, no others get through.

Plenty of examples on "Open Pipe for input" but no-one seems to be using output.

Would love some idea as to what is amiss here

Regards

Edit:https://web.archive.org/web/20200203114 ... interface/
Link to rc description.
SARG
Posts: 1876
Joined: May 27, 2005 7:15
Location: FRANCE

Re: Piping to VLC

Post by SARG »

Hi Dinosaur,

I found this parameter :

Code: Select all

-no-rc-fake-tty
--> Force the rc module to use stdin as if it was a TTY.

But also this :
On Windows PC be aware that -I rc does not later respond to standardInput commands sent.
I tested without success :-(
Dinosaur
Posts: 1507
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Re: Piping to VLC

Post by Dinosaur »

Hi All

Thanks for your reply SARG

I discovered that the problem is that vlc hogs the keyboard.
By pressing Alt Tab and returning the keyboard input to the cli, I can continue.

Code: Select all

Dim as string CmndPipe

CmndPipe = "vlc -I rc Skating.mkv"
Open Pipe CmndPipe for output As #1
sleep 1000
''Press Alt Tab to switch keyboard Input to Terminal
Do
        'This will be replaced by a Push button Input on Rpi.
	If Inkey <> "" Then
		Exit do
	EndIf
Loop
CmndPipe = "quit"
Open Pipe CmndPipe for output As #1
close

CmndPipe = "vlc -I rc Video1.mov"
Open Pipe CmndPipe for output As #1
sleep 1000
''Press Alt Tab to switch keyboard Input to Terminal
Do
	If Inkey <> "" Then
		'Close #1
		Exit do
	EndIf
Loop
CmndPipe = "quit"
Open Pipe CmndPipe for output As #1
close
end
What puzzles me is that without closing #1, I can open another pipe and send again on #1 ?

Now I am trying to find how to send Alt Tab to keyboard from within my code ??

Regards
Post Reply