vlc: VideoLAN VLC Media Player Control
1 Introduction
(start-vlc "dvd:///dev/dvd#1:2") (wait-for-vlc-active-playing) (vlc-seek 594)
2 Exceptions
- exn:fail:vlc
exn:fail:vlc:command
exn:fail:vlc:protocol
exn:fail:vlc:process
struct
(struct exn:fail:vlc? exn:fail ())
struct
(struct exn:fail:vlc:command? exn:fail:vlc (input output))
input : (or/c #f string?) output : (or/c #f string?)
struct
(struct exn:fail:vlc:protocol? exn:fail:vlc ())
struct
(struct exn:fail:vlc:process? exn:fail:vlc ())
3 Processes & Connections
parameter
(current-vlc vlc) → void? vlc : (or/c vlc? #f)
procedure
(start-vlc [ #:port port #:hostname hostname #:connecting-timeout connecting-timeout #:logger logger #:logger-level logger-level #:set-current-vlc? set-current-vlc? #:command command extra-args ...]) → vlc?
port :
(or/c #f (and/c exact-nonnegative-integer? (integer-in 1 65535))) = #f hostname : string? = "localhost"
connecting-timeout : (or/c #f (and/c real? (not/c negative?))) = 60.0 logger : (or/c #f logger?) = (current-logger)
logger-level : (or/c 'fatal 'error 'warning 'info 'debug) = 'info set-current-vlc? : boolean? = #t command : (or/c #f path-string?) = #f extra-args : (listof (or/c string? path?)) = '()
(start-vlc "--snapshot-path=/home/me/film-class/review-screenshots" "dvd:///dev/dvd")
(parameterize ((current-custodian <long-lived-custodian>)) (start-vlc))
4 URLs
String starting with a URL scheme, such as "http://example.com/foo.mp4". Note that this string must contain a %-escaped URL, with no spaces or other problematic characters.
url object, such as is produced by (string->url "http://example.com/bar/foo.mp4").
String not starting with a URL scheme, such as "/home/billybob/tractors.mp4", which is a file path.
path object, such as is produced by (string->path "/home/scotty/sheep.wav").
Byte string of a complete URL in UTF-8 encoding, including %-escaping. This is passed verbatim in the RC protocol.
5 Commands
5.1 Playlist
5.2 Repeat / Loop / Random
5.3 Title and Chapter
5.4 Play, Pause, and Stop
5.5 Rate
5.6 Absolute Position
procedure
seconds : exact-nonnegative-integer? vlc : vlc? = (current-vlc)
5.7 Audio, Video, and Subtitle Tracks
procedure
→
integer? (listof (cons/c string? (listof (cons/c string? integer?)))) vlc : vlc? = (current-vlc) (vlc-atrack num [#:vlc vlc]) → void? num : integer? vlc : vlc? = (current-vlc)
procedure
→
integer? (listof (cons/c string? (listof (cons/c string? integer?)))) vlc : vlc? = (current-vlc) (vlc-vtrack num [#:vlc vlc]) → void? num : integer? vlc : vlc? = (current-vlc)
procedure
→
integer? (listof (cons/c string? (listof (cons/c string? integer?)))) vlc : vlc? = (current-vlc) (vlc-strack num [#:vlc vlc]) → void? num : integer? vlc : vlc? = (current-vlc)
> (vlc-strack)
-1 |
'(("spu-es" |
("Disable" . -1) |
("Track 1 - [Français]" . 14) |
("Track 2 - [Español]" . 15) |
("Closed captions 1" . 17) |
("Closed captions 2" . 18) |
("Closed captions 3" . 19) |
("Closed captions 4" . 20))) |
5.8 Audio Options
5.9 Video Options
5.10 Misc. Info
> (vlc-get-title) "WEST_WING_S7_D3"
#"new input" – URL of the current playlist item.
#"audio volume" – number representing the audio volume.
#"state" – play state; possibly including the following values: #"playing", #"paused", #"stopped".
6 Snapshots
7 Exiting
8 Keys
procedure
vlc : vlc? = (current-vlc) (vlc-key-play-pause [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-pause [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-play [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-faster [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-slower [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-next [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-prev [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-stop [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-position [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-jump-extrashort [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-jump+extrashort [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-jump-short [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-jump+short [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-jump-medium [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-jump+medium [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-jump-long [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-jump+long [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-nav-activate [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-nav-up [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-nav-down [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-nav-left [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-nav-right [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-disc-menu [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-title-prev [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-title-next [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-chapter-prev [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-chapter-next [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-quit [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-vol-up [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-vol-down [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-vol-mute [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-subdelay-up [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-subdelay-down [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-audiodelay-up [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-audiodelay-down [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-audio-track [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-subtitle-track [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-aspect-ratio [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-crop [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-deinterlace [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-intf-show [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-intf-hide [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-snapshot [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-history-back [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-history-forward [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-record [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-dump [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-crop-top [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-uncrop-top [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-crop-left [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-uncrop-left [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-crop-bottom [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-uncrop-bottom [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-crop-right [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-uncrop-right [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-set-bookmark1 [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-set-bookmark2 [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-set-bookmark3 [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-set-bookmark4 [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-set-bookmark5 [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-set-bookmark6 [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-set-bookmark7 [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-set-bookmark8 [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-set-bookmark9 [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-set-bookmark10 [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-play-bookmark1 [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-play-bookmark2 [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-play-bookmark3 [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-play-bookmark4 [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-play-bookmark5 [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-play-bookmark6 [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-play-bookmark7 [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-play-bookmark8 [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-play-bookmark9 [#:vlc vlc]) → void? vlc : vlc? = (current-vlc) (vlc-key-play-bookmark10 [#:vlc vlc]) → void? vlc : vlc? = (current-vlc)
9 Other Operations
procedure
(wait-for-vlc-active-playing [ #:delay delay #:vlc vlc]) → void? delay : (and/c real? (not/c negative?)) = 0.1 vlc : vlc? = (current-vlc)
10 Known Issues
Finish implementing RC commands.
Need to verify that RC uses UTF-8, and consistently.
Should try to verify existence of objects before being added to the playlist, since otherwise VLC can keep trying them continuously and flooding with repeated error messages.
The protocol parsing is pretty good, but could still be improved. In particular, for some messages, it would be better to make the message end detection sensitive to the syntax of the message. Before doing that, verify that RC uses UTF-8 consistently.
Add a exn:fail:vlc exception, for ease of handling errors from the protocol, such as error-message output from RC commands. Currently, these are raised as exn:fail.
Make vlc-status return strings instead of byte strings, after making sure UTF-8 is consistent.
11 History
- Version 2:0 —
2016-02-28 Moving from PLaneT to new package system.
- Version 1:5 —
2012-12-13 Now requires Racket 5.3.1.
Now uses define-logger.
Now use vlc –extraintf instead of -I.
Removed erroneous (and undocumented) fields from exn:fail:vlc:protocol.
- Version 1:4 —
2012-10-03 Added RC key-related procedures.
- Version 1:3 —
2012-10-02 Added exception types.
- Version 1:2 —
2012-09-27 Documented that VLC 2.0.3 RC does not work on Windows, so this package does not support Windows.
- Version 1:1 —
2012-09-27 When start-vlc can’t find VLC in the executable search path, it will then try a few “known suspect” paths, including the standard one for Mac OS X. (Thanks to Greg Hendershott for reporting.)
Documentation for start-vlc regarding custodians has been corrected. (Thanks to Greg Hendershott for reporting.)
Updated documentation to say that this package has been reported to work on Mac OS X and Microsoft Windows XP.
- Version 1:0 —
2012-09-22 Preliminary release for testing some of the functionality on various host platforms and with various VLC versions in use. Not all commands are implemented, and little testing has been done.
12 Legal
Copyright 2012, 2016 Neil Van Dyke. This program is Free Software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. See http://www.gnu.org/licenses/ for details. For other licenses and consulting, please contact the author. VideoLAN, VLC, and VLC media player are trademarks of VideoLAN.