Cross Platform Music and Video Streaming with Subsonic

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)
Loading ... Loading ...

Update: See the changes to be made to the code for Subsonic 4.1 see this post. All other steps remain the same.

Subsonic is a free to use, web-based media streamer, providing ubiquitous access to your music. It can be used to share your music with family and friends, or to listen to your own music while at work. It provides great flexibility with support for multiple players simultaneously, i.e. any user can stream different music file simultaneously to different players. It has an in-built flash player and also supports most external players out there, further it supports on the fly audio transcoding making it possible to hear all media formats in your favorite music player. Unlike, SimplifyMedia it is also known to support large music collection running in several thousand songs.

Usage is quite simple, you just need to install Subsonic application on your desktop (and forward appropriate ports if you are behind a router). Since Subsonic is available for all OSs out there (Windows 7, Linux, Snow Leopard), you are free to run it on OS of your choice. Further, with SimplifyMedia no longer being developed, and iPod/iPhone (Z-Subsonic, iSub) as well as Android apps available for Subsonic, it is all set to become a leading cross platform personal music streaming software, which lets you set up your own DIY music server. Access to media files is available through web browser and user has the option to use it in Jukebox/Radio modes.

However, the video playback capability is not yet available out of the box. But enabling it is only mildly intensive, as described in subsonic forum (thanks to forum users Mohican and onewalrus). The details are also given below for your convenience. I am also including some more hacks facilitating video playback (without going in full screen mode). Only catch with video playback is that the seeking is not working currently, some possible solutions are being investigated. The approach being described is for Windows platform, but its implementation on a Linux box or a Mac should be very similar. I plan on putting up a Linux tutorial for the same soon.

Step 1: Download and install latest version of Subsonic to “c:/subsonic/ (this is usually the default location)

Step 2: Open “C:/subsonic/jetty/1130/webapp/WEB-INF/jsp/playlist.jsp” using a text editor like notepad or wordpad.

Step 3: Search for:

swfobject.embedSWF("<c:url value="/flash/jw-player-4.4.swf"/>", "placeholder", "340", "20", "9.0.0", 
false, flashvars, params, attributes);

and replace it with:

swfobject.embedSWF("<c:url value="/flash/jw-player-4.4.swf"/>", "placeholder", "340", "21", "9.0.0", 
false, flashvars, params, attributes);

Step 4: Again search for:

list[0] = { 
 duration:song.duration, 
 file:song.streamUrl, 
 title:song.title, 
 type:"sound" 
 }; 

 player.sendEvent("LOAD", list); 
 player.sendEvent("PLAY");

And replace it with:

list[0] = { 
 duration:song.duration, 
 file:song.streamUrl, 
 title:song.title, 
 type:"sound" 
 }; 

 if( song.format=="mpg" || song.format=="mpeg" || song.format=="avi" || song.format=="mp4" || song.format=="mkv" || song.format=="ogm" || song.format=="flv" ){ 
 list[0]["type"]="video"; 
 } 

 player.sendEvent("LOAD", list); 
 player.sendEvent("PLAY");

Step 5: Download FFMpeg from Here, and unpack all files to “c:/subsonic/transcode/”

Step 6: Open your browser and login to your subsonic server by pointing your browser to http://localhost (http://locahost:portno if you changed the port for subsonic)

Step 7: Go to Settings > General, and replace the content of “Music Mask” with this:

.mp3 .ogg .aac .flac .m4a .wav .wma .mpg .mpeg .avi .mkv .ogm .mp4

Step 8: Go to Settings > Transcoding, and add new transcoders one at a time, corresponding to .mpg, .avi, .mkv, .mp4, and .mpeg. Example for avi to flv is given below (entry in each box separated by |):

avi > flv  |  mpg  |  flv  | ffmpeg -re -y -i %s -ar 44100 -sameq -deinterlace -f flv -

Now your Transcoding setting should look like this:

Step 9: Now go to Settings > Players, and make sure your default player for your chosen current player is set to “Web Player”, and that all your new transcoders are checked in (scroll down to bottom of page to ensure this).

Step 10: Now go to Settings > Music Folders, and add your folder containing videos.

Step 11: Use the browsing system, and try to play a video with the default Player. After a few seconds the sound should start playing. Right Click on the JWPlayer, and select “Toggle Fullscreen” to start video in full screen mode. To play the video in windowed mode, once again open C:/subsonic/jetty/1130/webapp/WEB-INF/jsp/playlist.jsp and replace the number “21″ from step 3 above to “255″, and then open C:/subsonic/jetty/1130/webapp/WEB-INF/jsp/index.jsp. Change

frameset rows="70%,30%"

to

frameset rows="50%,50%"

Now you should be able to stream video using Subsonic. Whether you stream video or not, Subsonic offers unmatched liberty in streaming multimedia and allows you to access your music/video collection from remote location.

PS: People with low upload bandwidth might need to tweak their ffmpeg settings a bit.

If you found this useful, please consider leaving a comment or liking us on Facebook or following us on Twitter or subscribing to the RSS feed to have future articles delivered to your feed reader.

Possibly related posts (generated automatically):

  1. Setup Subsonic on Ubuntu to Stream / Access Your Video Collection
  2. Cross-Platform Music and Photo Sharing – Simplify Media (Windows 7/Snow Leopard/Ubuntu 9.10)
  3. Subtunes: Itunes like UI for subsonic music player
  4. Cross Platform Software KVM Switch (Share Keyboard Mouse Between Computers)
  5. Simple Streaming Music Server Using Apache musicindex
  6. How to Make Time Lapse Video from Images
  7. Install Driver for EasyCAP USB Video Capture Device in Ubuntu 10.04
  8. Best Remote Desktop / Multimedia Streaming App for iPod Touch, iPhone and iPad

You might also like

Subtunes: Itunes like UI for subsonic music player If you like...
Setup Subsonic on Ubuntu to Stream / Access Your Video Collection Subsonic is...
Simple Streaming Music Server Using Apache musicindex While there...
Cross-Platform Music and Photo Sharing – Simplify Media (Windows 7/Snow Leopard/Ubuntu 9.10) Update: Simplify...

About the Author

has written 1314 posts on this blog.

Meditating towards his "nerdvana", lifehacker is a teacher by the day and a nerdy blogger by the night. He lives to learn and yearns to learn living.

2 Comments on “Cross Platform Music and Video Streaming with Subsonic”

Trackbacks

  1. Cross-Platform Music and Photo Sharing – Simplify Media (Windows 7/Snow Leopard/Ubuntu 9.10) « Hack Your Life!
  2. Setup Subsonic on Ubuntu to Stream / Access Your Video Collection | Hack Your Life!

Write a Comment

Gravatars are small images that can show your personality. You can get your gravatar for free today!

*
Your Ad Here

Copyright © 2012 Hack Your Life!. All rights reserved.
Proudly powered by WordPress. Developed by Deluxe Themes