Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

VLC HTTP interface library.


  • Please log in to reply
26 replies to this topic
ColoQ
  • Guests
  • Last active:
  • Joined: --
Hy,

I entered the correct path C:\Program Files (x86)\VideoLAN\VLC\http\, activated html interface. 127.0.0.1 is not being saved. 8080 should be the default anyway, but it is strange, that the line is not saved at all. (Write Restrictions?)

I went to the vlc config file and added it there:


[oldhttp] # HTTP remote control interface

# Host address (Text)
http-host=127.0.0.1:8080


The location of the Config File:

Linux / Unix: $(HOME)/.config/vlc/vlcrc (v0.9.0 and above), $(HOME)/.vlc/vlcrc (v0.8 and older)
Mac OS X: HOME/Library/Preferences/org.videolan.vlc HOME/Library/Preferences/VLC (v0.9 and older)
Windows 95/98/ME: C:\Windows\Application Data\vlc\vlcrc
Windows 2000/XP: C:\Documents and Settings\%username%\Application Data\vlc\vlcrc
Windows Vista/7: C:\Users\%username%\Application Data\vlc\vlcrc
BeOS: config/settings/vlcrc

Now the adress appears correctly in the vlc Options.

then, from your library I came up with that script:


SC171::VLCHTTP_Pause()
SC12C::VLCHTTP_VolumeUp(12)
SC172::VLCHTTP_VolumeDown(12)
SC107::VLCHTTP_JumpForward(10)
SC108::VLCHTTP_JumpBackward(10)


It is using my additional keys. they are working with ahk.

But in VLC with the above commands, nothing happens. I see that the script is executing the command line in the ahk window, but vlc isn't doing anything.

Any mistakes?

specter333
  • Members
  • 627 posts
  • Last active: Oct 07 2016 07:43 AM
  • Joined: 15 Jan 2007
Oddly the 127.0.0.1 is not being saved on this computer either but the library still works. It is saved on my home computer, don't know what the differences is. I'm guessing it just doesn't get displayed when options is opened again since it does still work.

The only other difference I see is the final backslash which it would seem should be needed but I don't have it. Try without it and see if it makes any difference.

I'm trying to get checked out of my hotel right now and will have limited time to access the internet for the next few days but I'll keep working on this. Let me know if you figure out the problem.
I you need new version of any scripts I haven't re-uploaded yet feel free to pm me.

doyle
  • Members
  • 335 posts
  • Last active: Mar 02 2012 04:47 PM
  • Joined: 14 Nov 2007
Is there anyway to get a screen grab from VLC using this?

specter333
  • Members
  • 627 posts
  • Last active: Oct 07 2016 07:43 AM
  • Joined: 15 Jan 2007

Is there anyway to get a screen grab from VLC using this?



Nope, the number of commands available in the HTTP interface is limited.

The RC interface does have the capture commands but I have not been able to figure out how it works.
I you need new version of any scripts I haven't re-uploaded yet feel free to pm me.

doyle
  • Members
  • 335 posts
  • Last active: Mar 02 2012 04:47 PM
  • Joined: 14 Nov 2007
What about getting the size of the video being played?

I

specter333
  • Members
  • 627 posts
  • Last active: Oct 07 2016 07:43 AM
  • Joined: 15 Jan 2007

What about getting the size of the video being played?


The Status commands returns a lot of information about what is being played. You have to parse the returned information to retrieve specifics. If you try the example from the first post, the information returned from the status command is displayed on the first tab of the third window. Here is a function for getting the video size.

Add this to the library,
;;;;;;;;;;;;;;;;;;;;;;  Video Size  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
VLCHTTP_VidSize() ;   Returns the resolution of the currently playing item.
	{
	Status := VLCHTTP_Status()
	Loop, parse, Status, `n, `r  
		{
		IfInString, A_LoopField, Resolution
		Resolution = %A_LoopField%
		}
	VidRes := UnHTM(Resolution)
	Return, %VidRes%	
	}


Here's an example of it's use.
Gui, Add, Edit, x5 y5 w160 vVidSize,
Gui, Add, Button, x+5 40 gGetSize, Go
Gui, Show, Center w200 h40, Get Size
Return

GetSize:
Size := VLCHTTP_VidSize()
GuiControl , , VidSize, %Size% 
Return

I you need new version of any scripts I haven't re-uploaded yet feel free to pm me.

Eddy
  • Guests
  • Last active:
  • Joined: --
The lib didn't quite work for me at first (with VLC 2.0 and AutoHotkey_L Unicode), I had to:

- Activate VLC HTTP interface (obvious)

- Replace UrlDownloadToVar by
UrlDownloadToVar(URL, ByRef aResponse="") {
	WebRequest := ComObjCreate("WinHttp.WinHttpRequest.5.1")
	WebRequest.Open("GET", URL)
	WebRequest.Send()
	aResponse := WebRequest.ResponseText
	WebRequest := ""
}

- Replace e.g.
cmd = http://127.0.0.1:8080/?control=pause
and similar by
cmd = http://127.0.0.1:8080/requests/status.xml?command=pl_pause

Thanks for the library !

PS: I am quite new to this, so use at your own risk :p

specter333
  • Members
  • 627 posts
  • Last active: Oct 07 2016 07:43 AM
  • Joined: 15 Jan 2007
Actually this library doesn't work at all with VLC 2.**. They have rebuilt the the entire http interface. I'm not sure if it works on AHKL either.

I am working on a new library for the new VLC release. I'll post it as soon as I can.
I you need new version of any scripts I haven't re-uploaded yet feel free to pm me.

  • Guests
  • Last active:
  • Joined: --
hello, totally newbie, but, is it a way to have more options, like a record and stoprecord an rstp stream? Does this functionnality exists via http.request?
Thanks
chris

specter333
  • Members
  • 627 posts
  • Last active: Oct 07 2016 07:43 AM
  • Joined: 15 Jan 2007

hello, totally newbie, but, is it a way to have more options, like a record and stoprecord an rstp stream? Does this functionnality exists via http.request?
Thanks
chris

Not with this library and the old version of VLC but the new release of VLC may however I'm not where I can look at the moment. I have another post for VLCHTTP2 and it has many for functions, you should look at it, I think it does have what your looking for.
I you need new version of any scripts I haven't re-uploaded yet feel free to pm me.

  • Guests
  • Last active:
  • Joined: --
is this possible with itunes?

specter333
  • Members
  • 627 posts
  • Last active: Oct 07 2016 07:43 AM
  • Joined: 15 Jan 2007

is this possible with itunes?


Sorry, I don't know. I've never used itunes.
I you need new version of any scripts I haven't re-uploaded yet feel free to pm me.