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 nutt318 » Fri Dec 10, 2010 1:44 pm

Hi GJ51, Thanks for the info. I have a feeling my bandwidth at both locations are fine, I have cable which is 18mb down and 1mb up. My home machine is a core2 duo with 4 gigs of memory, is there anyway to test to see if my machine is the bottle neck? Maybe watch the system performance while movie is playing?

I'm currently running version 4.2 (build 1946). I was also wondering what is the best trans-coding options to set in the files. About 95% of my files are MKV's which some tv shows range from 700mb to 2.5gb. I haven't even tried a movie yet.

Here is my current trans-coding options:
ffmpeg -i %s -f flv -y -s 900x450 -ar 44100 -b 500kb -ab 32kb -ac 1 -

However the quality is very pix-elated, should I change anything in the playlist.jsp or trans-coding options?

Also is there any other type of codec that can provide better streaming quality?

Sorry for all the questions, thanks for the help.
Jake
nutt318
 
Posts: 54
Joined: Thu Dec 09, 2010 9:24 pm

Postby GJ51 » Fri Dec 10, 2010 4:25 pm

Your situation is a prime example of the difficulty involved in having a full appreciation of the capabilities of SS and the difficulty involved in getting it to run to each particular user's expectations.

My first question/suggestion is: What is the performance like internally? Before we move to a video over internet, have you gotten satisfactory results inside your home, or are you in a situation where you're only streaming from a single machine out to the internet?

I get pretty good results, but I'm running SS on quad core servers with 4GB and 8GB of ram, on a gigabit network, going out to the internet at 35mb/sec.

Remember too, that the CPU has to transcode the video unless you've pre-transcoded it to flv format. I've been doing a lot of work helping Users that also have the Android app, and a consistent issue is upload speed, and that's just for music. Video requires a lot more horsepower.

In your situation, I would start trying to get everything to run initially at the lowest reasonable settings, perhaps:

ffmpeg -i %s -f flv -y -s 384x240 -ar 44100 -b 256kb -ab 32kb -ac 1 -

You also need to verify that a video will run on the host server by logging in there and verifying that video will play. In the configuration I described, I have consistent problems getting the player to process properly. Changing to a different player name or refreshing the browser between play attempts usually gets it going.

Finally, I have it from good sources that many of these player issues will be resolved in an upcomming release that will include video play without having to go through all the mods that you and I had to do.

Bottom line, we are out on the bleeding edge on the project and there are alternatives to the embedded player method. You can set up an external player definition to tell SS to just send the video to the default player on the user's desktop.

To test your server to see if it's the bottleneck, open task manager (assuming you're running Windows) and monitor the CPU and memory useage.

Pardon my ramblings a bit here, but this project highlightsthe true nature of SS. Out of the box, accross all kinds of platforms, all running different hardware and OS's, this is about the best music streamer available today. Because of the nature of what it does, installation and setup is a step above the aveage user, you know - the relatives and friends that call and ask how to open email attachments. It's not a terrible setup, but having some knowledge of networking and port forwarding is very helpful to getting everything right.

Now we move into the video set up attempt, and we're at a whole new level wher we need to understand hardware resources and transcoding options just to get reasonable functionality. Definitely NOT for the fient of heart! But that is both the pain and joy of SS, it is a wonderful educational experience with a lot of rewards for perseverance.

Please keep me updated on your progress.
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 » Fri Dec 10, 2010 4:39 pm

GJ51,

I will have to check the performance once I get home, I was bored at work and setup everything remotely so I don't know what it looks like to my internal network. Everything is gigabit at home so like you said that will be the best thing to test first.

I will also run some speed tests once at home to see what my up/down is.

I've changed the transcoding settings to what you suggested, so I will start there and see what I have at home.

Another thing I need to try is the desktop player, I should have tried that first but I will install that shortly.

Also while streaming a video I remoted in to my server at home and cpu on 1 core didnt go over 25% and the second core was about 50%. So hopefully thats good sign that my machine is not the bottle neck.

So I've got some more testing to do at home first, thanks for the help and suggestions. I'll post my findings when I get home.

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

Postby tortfeaser » Tue Dec 14, 2010 9:49 am

Thanks for the writeup GJ51.

I've had some success with it on a FreeNAS server with the standalone v4.2 subsonic. (Version 4.2 (build 1944), server jetty-6.1.x, java 1.6.0_07, FreeBSD)

I can get the flash player to display on the SS page, but having it play something doesn't result in sound or video, though the log doesn't have any errors and the network activity increases as I'd expect when play is pressed.

But better still, if I enable external player with the playlist, VLC plays the video fine but throws an error 'VLC does not support the audio or video format "undf". Unfortunately there is no way for you to fix this.' The codec info in VLC indicates stream 1 is trying to play codec: undf, but with the correct sample and bit rates.

The Subsonic log displays as expected with adpcm_swf as the audio output. The question is why that doesn't get through to the client. (Log details below.)

I've tried the following ffmpeg transcode setting: ffmpeg -re -y -i %s -ar 44100 -sameq -deinterlace -f flv -

I've also tried various adding -acodec options, but if I pick something that works with flv I get the same error.

External player without playlist results in the same error but with no video playback.

Any ideas on how to fix?

Log
Code: Select all
[12/14/10 9:45:59 AM GMT]     DEBUG   InputStreamReaderThread   (/var/subsonic/transcode/ffmpeg) Input #0, avi, from '/mnt/NASraid/Media/TV/Amazing Race/Season 17/The.Amazing.Race.S17E03.PDTV.XviD-2HD.avi':
[12/14/10 9:45:59 AM GMT]    DEBUG   InputStreamReaderThread   (/var/subsonic/transcode/ffmpeg) Duration: 00:42:50.54, start: 0.000000, bitrate: 1142 kb/s
[12/14/10 9:45:59 AM GMT]    DEBUG   InputStreamReaderThread   (/var/subsonic/transcode/ffmpeg) Stream #0.0: Video: mpeg4, yuv420p, 512x384 [PAR 1:1 DAR 4:3], 29.97 tbr, 29.97 tbn, 29.97 tbc
[12/14/10 9:45:59 AM GMT]    DEBUG   InputStreamReaderThread   (/var/subsonic/transcode/ffmpeg) Stream #0.1: Audio: mp3, 48000 Hz, stereo, s16, 128 kb/s
[12/14/10 9:45:59 AM GMT]    DEBUG   InputStreamReaderThread   (/var/subsonic/transcode/ffmpeg) Output #0, flv, to 'pipe:':
[12/14/10 9:45:59 AM GMT]    DEBUG   InputStreamReaderThread   (/var/subsonic/transcode/ffmpeg) Stream #0.0: Video: flv, yuv420p, 512x384 [PAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 90k tbn, 29.97 tbc
[12/14/10 9:45:59 AM GMT]    DEBUG   InputStreamReaderThread   (/var/subsonic/transcode/ffmpeg) Stream #0.1: Audio: adpcm_swf, 44100 Hz, stereo, s16, 64 kb/s
[12/14/10 9:45:59 AM GMT]    DEBUG   InputStreamReaderThread   (/var/subsonic/transcode/ffmpeg) Stream mapping:
[12/14/10 9:45:59 AM GMT]    DEBUG   InputStreamReaderThread   (/var/subsonic/transcode/ffmpeg) Stream #0.0 -> #0.0
[12/14/10 9:45:59 AM GMT]    DEBUG   InputStreamReaderThread   (/var/subsonic/transcode/ffmpeg) Stream #0.1 -> #0.1
tortfeaser
 
Posts: 6
Joined: Fri Jul 31, 2009 2:37 am

Postby tortfeaser » Tue Dec 14, 2010 1:26 pm

So after a fair bit of stuffing around, I've got video streaming to work reliably, if with poor quality.

Using an external viewer with playlist, and transcode setting:

ffmpeg -re -y -i %s -acodec mp2 -ar 22050 -ab 48kb -vcodec mpeg4 -b 600kb -r 24 -f mpegts -

This is pretty poor video quality, flv when it works seems more reliable and better quality. Wish I could get that to work.

OTOH, this mpegts stream might have a chance at working with iOS devices, if you were so inclined.
tortfeaser
 
Posts: 6
Joined: Fri Jul 31, 2009 2:37 am

Postby GJ51 » Tue Dec 14, 2010 3:38 pm

There's no doubt that my setup is less than ideal, but for me it works once I get the player to start. I've only installed this on windows based platforms, so I don't know how it runs on other platforms.

I've poked around these forums pretty extensively, and though I don't remember the link, there is a to do list somewhere that appears to be a running note of things Sindre has planned. If I remember correctly, I think it said that incorporating video into SS was planned for the 4.3 release.

Being willing to concede, at the price of my fragile ego, that Sindre knows the program much better than I and is a far better programmer, let's hope that video functioanlity is on the horizon. If he can get it to work reliably on the server and incorporate it into the phone apps as well, this will be a breakthrough way ahead of the curve compared to the rest of the market.

For now, I'm really happy with the music server on my base setup, and I consider the server where I play the video to be my beta setup. Let's keep our fingers crossed that the release of a video enabled version is close at hand.

Thanks for the feedback. Please keep me posted if you make further progress.

EDIT: Just got an email that JW Player 5.4 has been released.

We have been amazed at the rapid adoption of the JW Player’s HTML5 support. Since the release of JW Player 5.3, we have had tens of thousands of users add HTML5 playback to their sites and their feedback has been overwhelmingly positive. Following on that success, we are pleased to announce the immediate availability of JW Player 5.4 and offer additional resources for leveraging the latest JavaScript features:
• JW Player 5.4 Released - Broader Mobile Support
• Replay: Introduction to the JW Player JavaScript API (Webinar)
• From Our Blog: Using the New JW Embedder
________________________________________
JW PLAYER 5.4 RELEASED — BROADER MOBILE SUPPORT
The latest version of the JW Player, JW Player 5.4, Introduces broader mobile support and includes a number of HTML5 improvements. Highlights:
• Download mode available for devices with no Flash or HTML5 capabilities
• The JW Embedder now supports Apple M3U8 playlists for HTML5
• Stretching mode configuration is honored in HTML5 mode
• The JW Embedder and JavaScript API are now compatible with additional JavaScript libraries, including MooTools and Prototype
• The JW Embedder allows wmode configuration for Flash mode


Maybe this will be a factor.
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 DJ Danni » Mon Jan 10, 2011 8:58 pm

Grate. ty that woorket Grate for me.
DJ Danni
My Subsonic
http://www.djdanni.com:5000
User avatar
DJ Danni
 
Posts: 10
Joined: Wed Jan 06, 2010 1:00 am

Postby deejay2302 » Wed Jan 26, 2011 11:28 am

I have done everything in the instructions from GJ51. I use the video format MP4 and FLV. This I would like to play in my podcast. I hear not a sound or I see a video. This problem I have since version 3.8. None of my attempts to bring the video player to work worked.. I've tried everything but nothing works.
So either I read wrong or am I doing something wrong. I can read and write a little English and, therefore, I would support a German were very nice.
Is not mandatory!

A new introduction to version 4.4 Beta 1 for Dummies would be good.

Would be great if someone could help me via private chat (ICQ, etc. ..)
I give it up slowly. Each time it works, not only with me.

I use a Windows 7 Enterprise Home Server
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 GJ51 » Wed Jan 26, 2011 4:47 pm

My first suggestion would be to start over with a clean installation of Subsonic.

Uninstall/reinstal latest Java version first, then follow these setup instructions.

First read: http://monroeworld.com/android/subsonic/

Never use port 80 - ISP's often use it or block it. 8080,8081, work fine.

In Subsonic Settings/Network - UNCHECK " Automatically configure your router to allow incoming connections to Subsonic (using UPnP or NAT-PMP port forwarding)." make sure to hit the SAVE button, you may have to scroll down to see it depending on your screen size. UPnP or Plug & Pray works sometimes, but not very often and you're better off learning what's going on anyway. You're dipping your toe into the network mgmt. thing anyway, might as well learn what's going on as home networks don't get simpler as time goes on. As your network gets more complex, you're going to have to learn this stuff! No time like the present.

Manually assign a fixed intenal IP and static route to your server at the upper end of the address range of the router, out of the way of DHCP, e.g. 192.168.1.254

Set up your router manually. uPNP might work, but most often it doesn't. Learing how to do it will be a skill you'll love having as your network grows.

Check the Subsonic Control Panel to make sure it's using the right port you're going to use. I typically use 8080, 8081, etc.

Set up port forwarding in your router to direct traffic on the selected port to your server.

Learn your external IP address assigned by your ISP.

Test your setup by entering your external IP:port# to see if it connects. e.g. http://24.88.76.61:8080/ If it works, you're good to go.

Default Transcoding for video:
ffmpeg -ss %o -i %s -async 1 -b %bk -s %wx%h -ar 44100 -ac 2 -v 0 -f flv -
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 deejay2302 » Fri Jan 28, 2011 6:34 am

GJ51 U missunderstand me! I have no problem with installation or configuration of subsonic!

I have ever actually Java Version (Autoupdate) and i works with Port 8080 and my ports are forwarded and connectable via internet (DynDNS ;)) Network configuration is no problem. Its simple^^

My Problem is, i will use Video podcasts and Videos and that does not work.
I will use MP4 and FLV Videos. And i need a new "How To" for my actually Subsonic.

U understand what i mean?
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 GJ51 » Fri Jan 28, 2011 7:28 am

Here's my current transcoding for mp4 > flv

ffmpeg -v 0 -ss %o -async 1 -i %s -f flv -b %bk -r 30 -s %wx%h -acodec copy -

It may or may not fix your problem. I'm working with another user where the problem seems to be that the rip from the source to mp4 format used an incompatible codec for the audio. If that's the problem, you'll have to test the conversion software you use to find the audio codec that works best when you rip the mp4. I use AVS Video Converter which uses MPEG2/4 Audio sample rate 44100 Hz, 16 bit with 128 kbps bitrate. for std def DVD. Check to see if that is an option for your video ripper to see if it's a codec problem in the rip process.
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 sfranklin1717 » Tue Jun 07, 2011 8:32 pm

In case anyone else is looking for video setup like I was, and was as confused as I was...SubSonic 4.4 has all this stuff built in. Gary J was kind enough to point it out to me in another thread...just put your video folder as a music folder in the settings, and go to town.
sfranklin1717
 
Posts: 7
Joined: Mon May 23, 2011 2:15 pm

Postby esper » Wed Jul 06, 2011 6:16 pm

sfranklin1717 wrote:In case anyone else is looking for video setup like I was, and was as confused as I was...SubSonic 4.4 has all this stuff built in. Gary J was kind enough to point it out to me in another thread...just put your video folder as a music folder in the settings, and go to town.


This doesn't seem to work for me. I get the "Video not found or access denied" error. I'm running Subsonic on Ubuntu. Any help?
esper
 
Posts: 15
Joined: Mon Jun 28, 2010 9:49 pm

Postby GJ51 » Wed Jul 06, 2011 8:09 pm

That's usually a transcoding error. Set up and test an flv file first to make sure things are working, then work on getting transcoding setting working.
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 esper » Fri Jul 08, 2011 4:28 am

GJ51 wrote:That's usually a transcoding error. Set up and test an flv file first to make sure things are working, then work on getting transcoding setting working.



Thanks for the reply. I tested out a .flv file, and it worked just fine. What would the next step be as far as messing with the transcoding settings? I don't now much about transcoding and I'm afraid to mess with anything since my music plays perfectly. Isn't this supposed to work "out-of-the-box" with the new version of Subsonic (which I have installed)?
esper
 
Posts: 15
Joined: Mon Jun 28, 2010 9:49 pm

PreviousNext

Return to Tutorials

Who is online

Users browsing this forum: No registered users and 16 guests