Streaming Video in JWPlayer with Subsonic 3.8 (with FFMpeg)

Tutorials, tips and tricks.

Moderator: moderators

How useful was this Tutorial:

Mohican is God!
13
57%
Mohican is Satan!
3
13%
I don't believe in either...
7
30%
 
Total votes : 23

Postby poopa » Sun Apr 25, 2010 7:54 pm

Im using the latest beta version (4.0)

Here are some screenshots. Hope it's enough.

Image
Image
Image
Image
Image
Image
poopa
 
Posts: 2
Joined: Sat Apr 24, 2010 9:21 pm

Postby Concept211 » Fri Apr 30, 2010 3:38 pm

I'm getting the exact same error as Poopa. Could this just be a Beta 1 bug?
User avatar
Concept211
 
Posts: 77
Joined: Sat Jul 05, 2008 8:55 pm
Location: Orlando, FL

Postby sindre_mehus » Fri Apr 30, 2010 7:27 pm

Yes. Please read this post: http://forum.subsonic.org/forum/viewtopic.php?t=3157

Cheers
Sindre
Subsonic developer
User avatar
sindre_mehus
 
Posts: 1955
Joined: Tue Nov 29, 2005 6:19 pm
Location: Oslo, Norway

Postby lemay86 » Fri Jun 11, 2010 1:15 am

For anyone having trouble with the original post as of subsonic 4.0.1 the original post of this sticky is out of date. The revised steps are below.

Once the playlist.jsp file is found the line :

Code: Select all
swfobject.embedSWF("<c:url value="/flash/jw-player


should be changed to:

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


Also, for part 4 in the function skip:

Code: Select all
  function skip(index) {
        if (index < 0 || index >= songs.length) {
            return;
        }

        var song = songs[index];
        currentStreamUrl = song.streamUrl;
        updateCurrentImage();
        var list = new Array();
        list[0] = {
            file:song.streamUrl,
            title:song.title,
            provider:"sound"
        };

        if (song.duration != null) {
            list[0].duration = song.duration;
        }
        if (song.format == "aac" || song.format == "m4a") {
            list[0].provider = "video";
        }

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


this should be changed to:
Code: Select all
  function skip(index) {
        if (index < 0 || index >= songs.length) {
            return;
        }

        var song = songs[index];
        currentStreamUrl = song.streamUrl;
        updateCurrentImage();
        var list = new Array();
        list[0] = {
            file:song.streamUrl,
            title:song.title,
            provider:"sound"
        };

        if (song.duration != null) {
            list[0].duration = song.duration;
        }
        if (song.format == "aac" || song.format == "m4a" || song.format == "mp4" || song.format == "m4v" || song.format == "flv") {
            list[0].provider = "video";
        }

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


Those revised steps will get video and sound working in subsonic 4.0.1. To the original poster if you can make these edits it will make it easier on the new people trying to get subsonic 4.0.1 setup for video.
lemay86
 
Posts: 22
Joined: Sat May 09, 2009 8:24 am

Postby Mycophiles » Mon Jul 12, 2010 4:06 am

I've gone through this thread most of the last couple hours. I never found the this:


1. My player on the web interface has disappeared. It's just not there anymore. I updated to Flash 10.0.45.2, Jw-player to viral, and got the latest release of the SWF objects, copied everybody to their correct locations, edited the playlist.jsp file to allow for the correct versions, and then my player disappeared. Does anyone know how to fix that?



I used the JW-player link and downloaded and copied the files. ( also looked for hidden files )

Also, the directions say to
1. Flash v.10,0,42,34 is the latest release. You can detect your version of Flash HERE With it's release, I found that jwplayer v. 4.4 no longer behaved consistently. I replaced the reference to flash version in C:\subsonic\jetty\1130\webapp\WEB-INF\jsp\playlist.jsp
from 9.0.0.0 to 10.0.42.34.

2. Swfobject: This file has also been updated to v.2.2 since the release of Subsonic 3.8. You can download it from HERE, extract and replace it in
C:\subsonic\jetty\1130\webapp\script
and
C:\subsonic\jetty\1130\webapp\flash

3. Jwplayer is now in version 5.0.753. The Subsonic package contains v.4.4. I downloaded this latest release HERE, and replaced it in C:\subsonic\jetty\1130\webapp\flash. When you do this, you also have to change the Subsonic reference to calling it.
Open the file C:\subsonic\jetty\1130\webapp\WEB-INF\jsp\playlist.jsp
Search for "swfobject"
Replace the
value="

on page 2.
The newest release of subsonic has most of the edits in there for you except where these directions say to put into the edit the player file and put in flash/flash/player-viral.swf. What's there is jwplayer 5.0 not 4.0 now so I kept that because I didn't see a flash/player-viral.swf file in that folder even after coping the files.

everything else I did. everything shows, I can right click the player and see the player is jw 5.0 and latest flash. I even reinstalled java.

Also, it says to copy the swfobject into both the flash folder and script folder. Though then when you follow the next direction it says to copy jwplayer into the flash folder it just copies over what you put in there.

I also used the different options provided.
ffmpeg -i %s -f flv -y -s 384x240 -ar 44100 -b 256kb -ab 32kb -ac 1 -
from the first post and
the options from the 2nd page. With no luck

Right now I can add the movies to the playlist but when I hit play it just sits there. Any ideas?
Mycophiles
 
Posts: 9
Joined: Mon May 24, 2010 5:15 pm

Postby rehatiel » Wed Jul 28, 2010 9:35 pm

Found a pretty good combination for encoding videos and I thought I'd share.

ffmpeg -re -y -i %s -b 800kb -ac 1 -ar 44100 -f flv -


Very basic, but it has the important things to me.. Just adjust the -b <number> if you have more upstream. 800kb looks pretty good and isn't a bandwidth killer for me.
rehatiel
 
Posts: 2
Joined: Wed Jul 28, 2010 2:24 am

playlist view

Postby jsidhu » Tue Sep 14, 2010 9:34 pm

I just got this going on the latest release, 4.1 and works very well. So thanks for work you guys put into getting video to work.

Anyone have a solution to the following?

1) be able to popout the jwplayer?
2) fix the playlist so if we window the player, we can still see whats in the current playlist.
jsidhu
 
Posts: 4
Joined: Tue Sep 14, 2010 8:46 pm

Postby stueyboy » Thu Sep 23, 2010 9:08 am

I'm on 4.1 beta (unable to update to 4.1 - unsure why) and have tried to set video up and everything seems to work except that I get a blank screen when I go to the player.

The log file shows that it is transcoding correctly so I am unsure if this is a server or client based problem. I don't get any audio either just a blank screen.

Looking through this thread, I can't see any similar posts. Is the player server based or client based? I have tried a couple of client machines as well as the server itself and all have the same issue.

Any help gratefully received. I have set up the transcoders as discussed in this thread and it all seems to be set up correctly

Ta
stueyboy
 
Posts: 46
Joined: Wed Sep 01, 2010 8:58 am

Postby deejay2302 » Mon Oct 11, 2010 6:19 am

Can anyone make a new working tutorial for 4.1 ? I have test all settings from the last post and does not work for me. I need the settings for MP4 format. For normal and HD videos.
I can not hear sounds and not see videos from my Podcasts :(

Can anyone help me pls? :(
21.681 Artists
58.141 Albums
674.091 Songs
5072,14 GB (~ 49.341 Hours)
User avatar
deejay2302
 
Posts: 165
Joined: Tue Oct 06, 2009 5:36 pm
Location: Germany

Postby madstan » Tue Oct 26, 2010 7:14 pm

I to cannot see video or hear sound i followed this post from beginnig to end made the changes that were posted. Im on ver 4.1 (build 1802) and still a nogo, any help would be grately appreciated.




madStan
subsonic supporter!
madstan
 
Posts: 4
Joined: Fri Jun 11, 2010 6:53 pm

Streaming Videos

Postby mayrken » Mon Nov 08, 2010 1:40 am

Is there a way to Embed the Divx WEB Player....I have been looking for a .swf for the Divx Player.

No Transcoding is needed.

My problem is this..I can Stream Videos fine with Wild Media Server with no Transcoding. I just dont like the WEB Interface of Wild Media Server....Subsonic is nicer and more Professional and you can customize.
Wild Media Server are Dynamic Pages that you cannot edit...stupid.

I try to Stream to and External Player Media Classic, Win Media Player, VLC and Divx Player.. I get an error message that the file is not recognized.
NOTE:I can play the Videos locally on my server with any of the players but not Streaming with Subsonic.
Like I said before Wild Media Server Streams the Videos.

I was thinking about making HTML Pages to link to the Videos and let Wild Media Server run as a BackOffice however that is alot of HTML Pages too create. I dont think Subsonic would let me do that.
mayrken
 
Posts: 11
Joined: Sat Oct 30, 2010 6:32 am

Postby JadoJodo » Tue Nov 16, 2010 4:36 am

@lemay86

This worked like a charm. Cheers!
User avatar
JadoJodo
 
Posts: 12
Joined: Mon Jan 25, 2010 6:04 pm
Location: Boise, ID

Postby GJ51 » Tue Nov 16, 2010 3:42 pm

I have the video working!

Here is what I did to enable video:

Subsonic 4.1 Video setup instructions for Windows

Step 1:

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

Step 2:

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

Step 3:

Search for:

"340" and that's the line you're looking for. Replace the "24" after it with a larger number, 255 gives you a nice player size with a 4:3 aspect ratio. You can tweak the player size to your liking.

Step 4:

Search for:

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

Just above this:

Replace:

if (song.format == "aac" || song.format == "m4a") {
list[0].provider = "video";
}

with:


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



Skip - Step 5:

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: "Name" "Convert from" and "Convert to" are the same as given in the example.



You can configure multiple conversion configuration for each file type - just be sure to give them different names and make sure only one is default (otherwise it will always go with the first). Then you can chose which encoding configurations to use in the Players tab. Then select the player you want to use based upon which device/data you are using.

Example 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:

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

Here is the encoding "Step 1" I use for use on 3G:
ffmpeg -i %s -f flv -y -s 640x480 -ar 44100 -b 200kb -ab 32kb -ac 1 -

Note that this can be changed to suit your needs:

-s is the frame size. For widescreen, use 800x450. If you will be watching mostly on a computer, pick a size appropriate for the videos you will be watching.

-ar is the audio sampling rate in Hz. This is probably a good number.

-b is the your video bitrate. This is where the tradeoff between bandwidth and quality takes place. You'll find 200kbps is pretty crappy, but it consistently works on 3G for me. You may be able to get 300-400 to work. Going to be watching on WiFi or that sweet, sweet 4G? Crank it up!
-ab is your audio bitrate. Want better sound quality? Turn it up?



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:
Open C:/subsonic/jetty/1130/webapp/WEB-INF/jsp/index.jsp. Change
frameset rows="70%,30%"
to
frameset rows="50%,50%"

50/50 can be replaced with whatever looks best to you.


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.
Now you should be able to stream video using Subsonic.

Subsonic offers unmatched flexibility for streaming multimedia, and allows you to access your music and video collection from remote locations.

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

_________________
Gary J

http://bios-mods.com
http://www.maplegrovepartners.com
http://theaverageguy.tv/category/tagpodcasts/cyberfrontiers/
User avatar
GJ51
 
Posts: 3492
Joined: Wed Oct 20, 2010 11:58 pm
Location: Western New York

Postby nutt318 » Thu Dec 09, 2010 9:27 pm

This thing works great, however I cant seem to find the best quality for streaming. I have a cable connection with 18down/1up and for some reason the picture is pretty grainy.

Anyone have any suggestions on what to try?

Thanks,
Jake
nutt318
 
Posts: 54
Joined: Thu Dec 09, 2010 9:24 pm

Postby GJ51 » Thu Dec 09, 2010 10:21 pm

There are lot of variables involved. Bandwidth, the transcoding power of the platform your running the server on, and the output capability of the playback device your sending the video to, just to name a few of the most obvious factors. Also remember that the video is never better than the original quality of the source.

My focus now is trying to decide just what is the best approach for setting this up. In that JWPlayer will play flash video without any transcoding needed, I may just transcode my videos into flash at a few different resolutions for playback on different devices.

I've got blue ray movies that play just fine in full 1080P after being transcoded into mp4's on my local network, but that is the extreme. I mostly want to put some low - med res flash video of home videos shot by the family for access by friends and family.

There is some discussion of various transcoding options in the forum posts that started all this in the early pages of this thread.

I'll also be stting up a virtual server this weekend to start testing on ver. 4.2 and I'll post here if all goes well. I'll also be reading through the code to see if we can add auto sizing of the player so that it adapts between the original size and the video size depending on what's being played. More fun.
Gary J

http://bios-mods.com
http://www.maplegrovepartners.com
http://theaverageguy.tv/category/tagpodcasts/cyberfrontiers/
User avatar
GJ51
 
Posts: 3492
Joined: Wed Oct 20, 2010 11:58 pm
Location: Western New York

PreviousNext

Return to Tutorials

Who is online

Users browsing this forum: No registered users and 14 guests