Monday, March 31, 2014

Connecting to Desktop VLC

In this guide you will learn how to connect VLC Direct Pro Free with VLC Player (installed in Windows, Linux or Mac). Once connected, you will be able to stream all kind of media content (videos, music and photos) between PC/Mac and Android devices.

Before you start, you must have installed VLC Player in your PC or Mac. You can find it <HERE>

If you have installed VLC 2.0.1 or VLC 2.0.4, please uninstall it and install VLC 2.1.3 because 2.0.1 and 2.0.4 versions crash when streaming to Android.
Other versions that work fine: 1.1.112.0.0 ,2.0.32.0.52.0.62.0.72.0.82.1.02.1.12.1.2

Once you have installed VLC in your PC or Mac, you must configure VLC to connect with VLC Direct Pro Free

No matter whether you have VLC installed in a PC, Linux or Mac OSX, the player needs to be started with some specific parameters in order to be able to connect with VLC Direct Pro Free and stream media to and from Android.

If you have VLC installed in Windows, we recommend you to use VLCDIRECT.BAT script which automatically configures VLC to connect with VLC Direct Pro Free. You can find it <HERE>

 

Running VLC from Command Line

If you are a Linux or Mac OSX user, or if you simply want to have full control of the VLC startup process, you can use the command line approach.

The parameters to be used will depend on the version of VLC you have installed.

To run the commands required to start VLC with parameters you must open a terminal. In windows you can do that in Windows->Search->cmd<enter>





Running VLC 1.1.x series from command line

VLC will start the web interface listening in port 8080, if the port is used, it will try with 8081 and so on until it finds an available port.

Be carefull because VLC won't tell you in which port is actually listening. VLC Direct Pro Free will try to find it in port 8080, but if VLC listens in other you must change it in VLC Direct Pro Free->menu->settings->Manual Configuration->Web Interface Port

You can check on which port is VLC listening from your web browser:

http://127.0.0.1:8080/requests/status.xml
http://127.0.0.1:8081/requests/status.xml
http://127.0.0.1:8082/requests/status.xml

the one which returns an xml response is the port to be used.
Another way to know the port is with the VLC messages log:



The good thing about VLC 1.x series is that the program only requires one parameter:
--extraintf http

Here's the command line to execute for all operating systems supported:



Windows (32bits):
"C:\Program Files\VideoLan\VLC\vlc.exe" --extraintf http
Windows (64bits):
"C:\Program Files (x86)\VideoLan\VLC\vlc.exe" --extraintf http

Linux: 
vlc --extraintf http
Mac OSX:
/Applications/VLC.app/Contents/MacOS/VLC --extraintf http
Parameters Description
  • --extraintf http: Automaticaly enables the web interface



Configure and run VLC 2.0.x from command line

CONFIGURATION
By default, the web interface in VLC 2.0.x series are only accessible from localhost. To allow VLC Direct Pro Free connect to the VLC web interface, you need to configure VLC to listen for remote connections (i.e connections from LAN or Internet).

If you see the messages log of VLC you will see something like this when you enable the web interface:



Note the lines that start with "restricted... ". This means VLC is only listening only for connections coming from localhost.

By default, the configuration file that must be edited is named .hosts or .host, and it is located in the following paths depending on the operating system:

Windows (32bits): C:\Program Files\VideoLan\VLC\lua\http\.hosts
Windows (64bits): C:\Program Files (x86)\VideoLan\VLC\lua\http\.hosts
Linux: /usr/share/vlc/lua/http/.host
Mac: /Applications/VLC.app/Contents/MacOS/share/http/.hosts

Note that you might need administrator (or root) privileges to find, modify and save the file.

Once you find the file, open it with your favourite text editor, and make it look exactly like the text below. Please note the ashes (#) in the begining of the lines.


# ------------------------------------------------------------ START OF THE FILE -----------------------------------------------
#
# Access-list for VLC HTTP interface
# $Id$
#

# localhost
#::1
127.0.0.1

# link-local addresses
#fe80::/64

# private addresses
#fc00::/7
#fec0::/10

# The world (uncommenting these 2 lines is not quite safe)
#::/0
# ------------------------------------------------------------ END OF THE FILE -----------------------------------------------

Then save the file, restart VLC, enable its web interface and run the Automatic Connection Wizard in VLC Direct Pro Free.

After this change, you should see in the VLC messages Box this lines:



Note that this time appears more "restricted... " lines. This means VLC is also listening for connections from any privated network: 192.168.0.0, 172.16.0.0, and 10.0.0.0.

VLC Direct Pro Free should find VLC now.

Important Notes:
This configuration presumes you have your PC/Mac and your android device both connected to the same wifi router. That means both devices are in the same LAN, sharing the same network.




RUNNING VLC
Once you have VLC properly configured to listen to remote connections, run VLC using the following parameters:
--sout-ffmpeg-strict=-2
--rtsp-timeout=99999
--extraintf http
--http-port=8080

The following are the command lines for each operating system


Windows (32bits):
"C:\Program Files\VideoLan\VLC\vlc.exe" --rtsp-timeout=99999 --sout-ffmpeg-strict=-2 --extraintf http --http-port=8080

Windows (64bits):
"C:\Program Files (x86)\VideoLan\VLC\vlc.exe" --rtsp-timeout=99999 --sout-ffmpeg-strict=-2 --extraintf http --http-port=8080 
Linux:
vlc --rtsp-timeout=99999 --sout-ffmpeg-strict=-2 --extraintf http --http-port=8080


Mac:
/Applications/VLC.app/Contents/MacOS/VLC --rtsp-timeout=99999 --sout-ffmpeg-strict=-2 ---extraintf http --http-port=8080
Parameters Description
  • --extraintf http:  Automaticaly enables the web interface
  • --rtsp-timeout=99999: Solves a problem that appears since VLC version 2.0.0, which stops streaming from PC/Mac to Android after a few seconds (60 seconds in v2.0.0 to v2.0.7 and 15 seconds in v2.0.8+)
  • --http-port=8080: Defines that Web Interface will listen on port 8080. This port must be setup in VLC Direct Pro Free->menu->settings->Manual Configuration->VLC Web Interface Port
  • --sout-ffmpeg-strict=-2:  Helps VLC find the correct audio codecs for streaming. Without this parameter, streaming from PC/Mac to android will probably show a codec error window in VLC or the videos will have no sound.
Running VLC 2.1.x from command line


There are a lot of changes between VLC 2.0.x and VLC 2.1.x versions. Good news is that since VLC 2.1, there's no need to edit files to make VLC reachable from VLC Direct Pro Free. But now it requires a HTTP Password to access it. This password can be setup inside vlc (use vlcdirect as password):




Note: The default HTTP Password used by VLC Direct Pro Free is "vlcdirect", so in the following parameters the http-password is always configured as "vlcdirect" so you don't have to change anything in VLC Direct Pro Free.

If you want to use another password, please remember that both passwords must match, so change it in both places: In VLC (with the parameter or in the GUI) and in VLC Direct Pro Free->menu->settings->HTTP Password.

Another way to setup VLC parameters is from command line. To start VLC properly configured use the following parameters:

--rtsp-timeout=99999
--http-password=vlcdirect
--sout-avcodec-strict=-2
--extraintf http
--http-port=8080


The following are the corresponding command lines for each operating system:


Windows (32bits):
"C:\Program Files\VideoLan\VLC\vlc.exe" --rtsp-timeout=99999 --http-password=vlcdirect --sout-avcodec-strict=-2 --extraintf http --http-port=8080
Windows (64bits):
"C:\Program Files (x86)\VideoLan\VLC\vlc.exe" --rtsp-timeout=99999 --http-password=vlcdirect --sout-avcodec-strict=-2 --extraintf http --http-port=8080
Linux:
vlc --rtsp-timeout=99999 --http-password=vlcdirect --sout-avcodec-strict=-2 --extraintf http --http-port=8080
Mac:
/Applications/VLC.app/Contents/MacOS/VLC --rtsp-timeout=99999 --http-password=vlcdirect --sout-avcodec-strict=-2 --extraintf http --http-port=8080

Parameters Description
  • --extraintf http: Automaticaly enables the web interface
  • --rtsp-timeout=99999: Solves a problem that appears since VLC version 2.0.0, which stops streaming from PC/Mac to Android after a few seconds (60 seconds in v2.0.0 to v2.0.7 and 15 seconds in v2.0.8+)
  • --http-password=vlcdirect: Since 2.1.0, VLC uses a password to authenticate connections to its web interface. This password must be setup also in VLC Direct Pro Free->menu->settings->VLC HTTP Password
  • --sout-avcodec-strict=-2: Helps VLC find the correct audio codecs for streaming. Without this parameter, streaming from PC/Mac to android will probably have no sound.
  • --http-port=8080: Defines that Web Interface will listen on port 8080. This port must be setup in VLC Direct Pro Free->menu->settings->Manual Configuration->VLC Web Interface Port

34 comments:

  1. I can't stablish the connection between my android device and the vlc interface, when i go to the command line it appears an error as follows

    xxxx@xxxx ~ $ vlc --rtsp-timeout=99999 --sout-ffmpeg-strict=-2 --extraintf http --http-port=8080
    VLC media player 2.0.8 Twoflower (revision 2.0.8a-0-g68cf50b)
    [0x9282d8] [http] lua interface: Lua HTTP interface
    [0x9282d8] [http] main interface error: socket bind error (Permission denied)
    [0x9282d8] [http] main interface error: socket bind error (Permission denied)
    [0x9282d8] [http] main interface error: cannot create socket(s) for HTTP host
    [0x9282d8] [http] lua interface error: Error loading script /usr/lib/vlc/lua/intf/http.luac: lua/intf/http.lua:333: Failed to create HTTP host
    [0x861108] main libvlc: Ejecutar vlc con la interfaz predeterminada. Use «cvlc» para usar vlc sin interfaz.
    "sni-qt/4567" WARN 12:59:54.846 void StatusNotifierItemFactory::connectToSnw() Invalid interface to SNW_SERVICE

    ReplyDelete
  2. You might have another process listening on port 8080. Try changing the parameter to 8081. If it works, then you have to use 8081 in VLC Direct Pro Free->menu->settings->manual configuration->web interface port

    ReplyDelete
  3. I'm running VLC 2.1.4 on my MAC. My version doesn't seem to have a '.hosts' file on it. The command line isn't working for me either. Is there ANY way I can configure these parameters.

    ReplyDelete
  4. I keep seeing this error. I can't figure out how to fix it.

    [0x104f5d9b0] filesystem access error: cannot open file /Users/aramirez/http (No such file or directory)

    ReplyDelete
  5. Password won't even work. Both have matching passwords, but still says it's the wrong password.

    ReplyDelete
    Replies
    1. Try reinstalling VLC Direct Pro Free in your android device. That should work

      Delete
    2. Same issue, did not work.

      Delete
  6. It works great I just want to remove the ads

    ReplyDelete
  7. Did all that (in Linux). Can't get it to work. Why does VLC on my phone need to connect to my PC anyway? All I want from it is to be able to see a video which is on my phone but the standard Android stuff seems unable to play Ogg Theora files.

    I like VLC and it is my standard DVD player but I have uninstalled this from my phone. Shame, but it just wasn't user friendly or intuitive enough when problems arose in the configuration.

    ReplyDelete
    Replies
    1. There is a normal VLC app that does not connect to a computer.

      Delete
  8. All this was about computers.. I downloaded it from the app store on my android but I can't get it to connect to my phone. Do you need to have it on a computer first to have our on your android?

    ReplyDelete
  9. I am using 2.1.3 version in my windows 7. Not able to stream phone videos in my system. After auto connection settings in vlc direct pro in pc VLC getting error
    ###############################
    Your input can't be opened:
    VLC is unable to open the MRL 'http://192.168.X.X:4444/1'. Check the log for details.
    ###############################

    Any one can help me in this.

    ReplyDelete
  10. Does not work! No video or audio on my tablet.

    ReplyDelete
    Replies
    1. I got the same problem with my Samsung S4 Active. I got no sound and no picture. Is there an solution for this?

      Delete
  11. How can I remove or delete Ad-On and Extension Apps?and Pop-up from Search Engine/SEO? and why myHard drives_running “out the box“_and so bump and “Robust“? thank you if myFriend pleasure Help resolve myproblem*_canbe bestfriends*

    ReplyDelete
  12. I cannot stream from my PC to my android (Samsung Galaxy S4).

    My VLC (2.1.4) command line is:

    "c:\Program Files\VideoLAN\VLC\vlc.exe" --http-port 8080 --http-password vlcdirect --sout-ffmpeg-strict=-2 --rtsp-timeout=99999 --sout-avcodec-strict=-2 --no-video-title-show --extraintf http

    VLC messages say:

    x264 info: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
    x264 info: profile Constrained Baseline, level 1.3
    x264 info: frame I:74 Avg QP:20.40 size: 16534
    x264 info: frame P:1107 Avg QP:21.33 size: 3860
    x264 info: mb I I16..4: 40.2% 0.0% 59.8%
    x264 info: mb P I16..4: 5.6% 0.0% 0.0% P16..4: 41.0% 0.0% 0.0% 0.0% 0.0% skip:53.4%
    x264 info: coded y,uvDC,uvAC intra: 45.5% 50.4% 21.8% inter: 14.8% 14.0% 0.7%
    x264 info: i16 v,h,dc,p: 44% 18% 17% 21%
    x264 info: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 30% 19% 16% 7% 7% 6% 6% 5% 5%
    x264 info: i8c dc,h,v,p: 65% 14% 18% 4%
    x264 info: kb/s:930.75
    x264 info: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
    x264 info: profile Constrained Baseline, level 1.3
    canvas error: Width and height options must be set
    main error: Failed to create video filter2 'canvas'
    main error: Failed while trying to append 'canvas' to filter chain
    x264 info: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
    x264 info: profile Constrained Baseline, level 1.3

    Can this work, or is it a lost cause?

    Thanks,


    A

    ReplyDelete
  13. This comment has been removed by the author.

    ReplyDelete
  14. This comment has been removed by the author.

    ReplyDelete
  15. I'm getting video but no audio when streaming!?

    ReplyDelete
  16. Hi. On Android I am getting message VLC found but the HTTP password is wrong. Passwords for both app and linux set to vlcdirect. Have tried this via config file and via command line on ports 8080 and 8081. Here is command line I am using on Ubuntu 14.04 with vlc 2.1.4 Android 4.1.2 by the way on Samsung GT-80120.
    vlc --rtsp-timeout=99999 --http-password=vlcdirect --sout-avcodec-strict=-2 --extraintf http --http-port=8081

    vlc2.1.4 doesn't seem to have a setting for http port in the GUI

    Strangely when I run vlc without any of the above options on 8080 I can see the web interface on the android tablet using Chrome with no password requested since original set even though I have changed it on linux box.

    Any further ideas?

    ReplyDelete
    Replies
    1. Hi Jaes, try reinstalling VLC Direct Streaming Pro Free. That usually solves the problem.

      Delete
  17. This comment has been removed by the author.

    ReplyDelete
  18. I actually managed to connect to my PC. But When I try to stream videos from my PC there is no sound or picture, the progress indicator is moving at the bottom as if the movie was playing normal but no sound or picture. Anyone know how I can fix this

    ReplyDelete
    Replies
    1. Found a semi OK solution in this: VLC Direct internal player might be unable to stream the video. Try enabling external player (VLC Direct->menu->settings->player->external player). Then VLC Direct will use any video player you have installed in your device to stream the video (recommended free video players: MX Player, vPlayer, Mobo Player, VLC Beta). The inconvinience with this solution is that you won't be able to control the video from the device (i.e. pause, position, volume, etc.) But there must be a way for the player in the app to play the videos as well, Its really no use in the app if u cant pause or fast forward the video.If u pause the video u must start from the start again.

      Delete
  19. I got the very same problem. I can remote control my PC and see the progress bar on Android, but video and audio are on my PC only. Android keeps displaying the file list

    ReplyDelete
  20. The semi OK solution does not work for me. I do have MX Player installed and I already tried switching between internal and external. I don't get any video in both cases.

    ReplyDelete
  21. I have to revise my issue. After restarting the tablet, streaming regular video files works fine - using the internal or an external player (the latter without controls).
    However, I could not find a way to stream DVDs. When I mount an ISO from Android, it displays correctly as long as I direct output to the PC, I can even control it from android. However, when I switch output to Android, all I get is buffering and a black screen (internal player) or buffering errors / media type errors when using an external player.
    Is streaming an DVD to android even possible / supposed to be working?

    ReplyDelete
  22. streaming from PC to phone (watching from phone) is quite laggy. Any tips?

    ReplyDelete
  23. callpccare provide expert repair and maintenance on all types of desktop and laptop repair services we can assist in all your service. Just call toll free number 1-800-457-6839 to get full tech support for computer repair for the best support experience computer experts.

    ReplyDelete
  24. Thanks for share " Connecting to Desktop VLC " really awesome blog . keep it up!! click this link Windows live mail support also Call +1-800-231-4635 (Toll Free).

    ReplyDelete
  25. I have tried what was suggested but my phone cannot connect to my PC. Error message on phoen when trying to connect read: Check that you have VLC Media player running (true), its web Inteface is enabled (true), [password set to vlcdirect], and it has permissions for remote connections (bu how do I do this, where to set the permissions?)

    ReplyDelete