Tuesday, June 22, 2010

Video Streaming to Android Nexus One using VLC

After reading a discussion on the MythTV Cast forum I explored VLC video steaming to my Android Nexus One. After some searching I found this helpful page. From that page I got VLC video streaming to my Nexus One working by doing the following:

I created a html page on my MythTV server called stream.html with the following contents:


<html>
<head>
VLC Streaming to Nexus One
</head>
<body>
<h1>VLC Streaming to Nexus One</h1>
<a href="rtsp://192.168.1.5:5554/stream.sdp">Stream</a>
</body>
</html>


I started an http server on my MythTV server using python -m SimpleHTTPServer. I started this command in the same directory I saved the stream.html file in.

I started the VLC streaming with the following single line command:


vlc Hot_in_Cleveland_2010-06-16_10-00_PM_Pilot.mpg -I http --sout "#transcode{soverlay,ab=128,samplerate=44100,channels=2,acodec=mp4a,vcodec=h264,width=480,height=270,vfilter="canvas{width=480,height=270,aspect=16:9}",fps=25,vb=800,venc=x264{level=12,no-cabac,subme=20,threads=4,bframes=0,min-keyint=1,keyint=50}}:gather:rtp{mp4a-latm,sdp=rtsp://0.0.0.0:5554/stream.sdp}"


Then with my WiFi connected Nexus One I open the browser to http://192.168.1.5:8000/stream.html

I clicked on the stream link and watched the video file Hot_in_Cleveland_2010-06-16_10-00_PM_Pilot.mpg specified in the VLC command.

I've only got an standard definition recording to play so far. My HD recordings playback with a blank screen. I hear the audio. I'm sure there are some settings I need to tweak on the VLC command.

Below are the specs from the video as provided by the ffmpeg command.


Input #0, mpeg, from 'Hot_in_Cleveland_2010-06-16_10-00_PM_Pilot.mpg':
Duration: 00:29:57.80, start: 0.189267, bitrate: 5188 kb/s
Stream #0.0[0x1e0]: Video: mpeg2video, yuv420p, 480x480 [PAR 4:3 DAR 4:3], 6000 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
Stream #0.1[0x1c0]: Audio: mp2, 48000 Hz, 2 channels, s16, 384 kb/s

1 comment:

Arunciks said...

Ok... for the past couple days I was in the quest to get my shared library working through UPNP on Nexus One.

None of the online tutorials seemed to be acceptable and working to me. Some of those solutions are nice but not what I wanted. Homepipe, Audiogalaxy, subsonic, VLC Stream and Convert.
So I was able to get alll working - almost perfectly to WIFI and pretty good over 3G.

Make sure you follow these steps:

PC server side:
1. Download and install these codecs with default settings:
http://www.cccp-project.net/download.php?type=cccp

2. Reboot your PC.

3. Download and install Tversity:
http://tversity.com/download

4. Start TVersity and make sure the service is runing(Settings>General>Start Sharing (If Windows standard UPNP Service is runingand start Automatically - might conflict with TVersity)

5. Setup your library : Library> Add Items>

Add Video, Music, Pictures, Internet Feed.. and so
Advanced Settings : I have Transcode checkbox set to Always.

All the files will be added to library it might take a long time depending on the quantity.

6. To test open your browser on PC and type:
http://localhost:41952/

You should be able to see the library list, if you dont make sure the TVersity service is runing and firewall allowing 41952 port.

7. Test the TVersity Flash interface in your browser (navigating with mouse or keyboard keys):
http://localhost:41952/flashlib/

Now connect your Nexus One to wifi maje sure no firewall blocking port 41952, open browser and type http://localhost:41952/flashlib/

The flash page should load and you will be able to navigate throught the library using the trackball, since the touchscreen is a little bit of.


Optional:
Now if you planing to access the library from the outside network - not WIFI - my sugestion would be to setup free dynamic DNS client on PC. I use dyndns.org

Pick your subdomain name and enter your outside modem address (use whatsmyip.org to find out)

1. enable Tversity to accept outside requests:

Tversity> settings> general> Home network
check the checkbox: The media server should accept requests....

Setup username and password

2. Open and forward nessecarry ports on your router.

And all set....

I am able to type my dns - blahblahblah.dyndns.org anfd access my Tversity from my Nexus and outside of my local network.

Enjoy..:)...