Streaming Video in JWPlayer with Subsonic 3.8 (with FFMpeg)
Posted: Mon Dec 28, 2009 11:43 am
I finally managed to get this working after trawling the forum for hours!!
Along the way I made some improvements of my own that cured strange bugs, so the resulting product works real nice and smooth.
I thought you guys would like to see this all laid out in a single thread... (and it is usefull to me as a memo )
Here we go:
(1) Install Subsonic 3.8 to "c:\subsonic\" (it's all lower case)
(2) Open "C:\subsonic\jetty\1130\webapp\WEB-INF\jsp\playlist.jsp" with notepad
(3) Search for string ".swf", and replace:
with
(4) Search for string "function skip", and replace:
with
(5) Download FFMpeg Here, and unpack all files to "c:\subsonic\transcode\"
(6) Open Firefox or Internet Explorer (or whatever else) on your PC running subsonic, open "http://localhost" and login.
(7) Go to settings > general, and enter this in "Music Mask":
[8] Go to settings > transcoding, and add new transcoders one at a time.
Notes:
- I removed parameter "-re", so videos get converted super fast and sent straight away (no waiting for stream to start!!)
- s 384x240 is resolution of video
- ar 44100 is audio frequency
- b 192kb is target bitrate
- ab 32kb is target audio bitrate
- ac 1 is number of channels (1=mono, 2=stereo)
I use these values because my broadband connection's upload is crap (256kb). If you wanna stream on a better connection like a LAN, pump up all those params.
(9) Go to Settings > Players, and make sure your default player is set to "Web Player", and that all your new transcoders are checked in (scroll down to bottom of page).
(10) Now go to Settings > Music Folders, and add your folders containing videos.
(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...".
Et Voila!!! Enjoy my friends!!!
Please lemme know if you successfully used this tutorial.
Along the way I made some improvements of my own that cured strange bugs, so the resulting product works real nice and smooth.
I thought you guys would like to see this all laid out in a single thread... (and it is usefull to me as a memo )
Here we go:
(1) Install Subsonic 3.8 to "c:\subsonic\" (it's all lower case)
(2) Open "C:\subsonic\jetty\1130\webapp\WEB-INF\jsp\playlist.jsp" with notepad
(3) Search for string ".swf", and replace:
- Code: Select all
swfobject.embedSWF("<c:url value="/flash/jw-player-4.4.swf"/>", "placeholder", "340", "20", "9.0.0", false, flashvars, params, attributes);
with
- Code: Select all
swfobject.embedSWF("<c:url value="/flash/jw-player-4.4.swf"/>", "placeholder", "340", "21", "9.0.0", false, flashvars, params, attributes);
(4) Search for string "function skip", and replace:
- Code: Select all
list[0] = {
duration:song.duration,
file:song.streamUrl,
title:song.title,
type:"sound"
};
player.sendEvent("LOAD", list);
player.sendEvent("PLAY");
with
- Code: Select all
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");
(5) Download FFMpeg Here, and unpack all files to "c:\subsonic\transcode\"
(6) Open Firefox or Internet Explorer (or whatever else) on your PC running subsonic, open "http://localhost" and login.
(7) Go to settings > general, and enter this in "Music Mask":
- Code: Select all
.mp3 .ogg .aac .flac .m4a .wav .wma .mpg .mpeg .avi .mkv .ogm .mp4
[8] Go to settings > transcoding, and add new transcoders one at a time.
- Code: Select all
Example:
mpg > flv | mpg | flv | ffmpeg -i %s -f flv -y -s 384x240 -ar 44100 -b 192kb -ab 32kb -ac 1 -
Notes:
- I removed parameter "-re", so videos get converted super fast and sent straight away (no waiting for stream to start!!)
- s 384x240 is resolution of video
- ar 44100 is audio frequency
- b 192kb is target bitrate
- ab 32kb is target audio bitrate
- ac 1 is number of channels (1=mono, 2=stereo)
I use these values because my broadband connection's upload is crap (256kb). If you wanna stream on a better connection like a LAN, pump up all those params.
(9) Go to Settings > Players, and make sure your default player is set to "Web Player", and that all your new transcoders are checked in (scroll down to bottom of page).
(10) Now go to Settings > Music Folders, and add your folders containing videos.
(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...".
Et Voila!!! Enjoy my friends!!!
Please lemme know if you successfully used this tutorial.