Optimizing Video Streaming

Need help? Post your questions here.

Moderator: moderators

Optimizing Video Streaming

Postby noipod » Sun Sep 16, 2012 9:50 pm

Thanks for creating an AWESOME streaming platform. I have a few questions:

"Server": Dell Optiplex 790 (i7 processor), 4.53Mbps down, 0.74Mbps up (per Speakeasy)
Phone: Droid Bionic (dual core CPU), 7.95Mbps down, 4.11Mbps up

Music (even .flac) files are transcoded and stream great. However video is always choppy when streaming to my phone.

How can I optimize settings, or what can I do to stream video smoothly? Would I be able to stream 720P smoothly?

I appreciate any input.
noipod
 
Posts: 21
Joined: Sun Aug 21, 2011 9:37 pm

Re: Optimizing Video Streaming

Postby bushman4 » Mon Sep 17, 2012 2:58 pm

First thing I would do is update to the latest version of static ffmpeg.exe for your platform from http://ffmpeg.zeranoe.com/builds/.

Secondly, how does your CPU look on the server when playing video remotely?

Glenn
Glenn Sullivan
Subsonic 6.1.6 (Unraid Docker)
90 regular Subsonic Users

Library as of 2024-10-28:
4,527 artists
19,996 albums
282,151 songs
10201.40 GB
41,583 hours
User avatar
bushman4
 
Posts: 875
Joined: Thu Dec 02, 2010 1:47 pm
Location: Massachusetts, USA

Re: Optimizing Video Streaming

Postby GJ51 » Mon Sep 17, 2012 5:05 pm

Using the latest ffmpeg build is usually very helpful.

The bottleneck in your case is the upload speed from your server at .74mbps. Your cell download speed looks fine, but those tests can sometimes be a bit deceptive as cell connections tend to run in fits and starts and don't always provide a steady connection even though the avg dnld speed looks fine.

The first thing you want to do is to make sure that video playback is smooth on the local host, then test to get the same result on other systems inside your network. If that all looks good then test your phone on you network using wifi. If that's fine, but you then have trouble over a cellular connection, then you know it's the cell connection that's having trouble feeding the data.

The default speed for video is 500kbps. If you are getting buffering, try lowering to 200kbps to see if that has an impact.

720p should be no problem over wifi.

Other than your upload speed from the server being less than ideal, you should have enough horsepower to stream video without too many problems if everything is set up properly. My video playback works flawlessly with the exception that I only get the normal crappy Sprint 3g download speeds when I'm outside my network. Sometimes I struggle to get 256kbps down over 3g and then the video is useless, but whenever I have enough download speed, everything works as it should.

If you have any other questions or would like to test your phone on my server, just send me a PM.

HTH
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

Re: Optimizing Video Streaming

Postby noipod » Tue Sep 18, 2012 1:02 am

Thanks for the input, another question:

I downloaded the latest 32-bit Build (Static). I unzipped. I'm not sure what I need to do next?

Video plays fine on local host.

Video also seems to play well over wifi.

When streaming over 4G, the CPU usage seems to kick up to 100% (sometimes) when buffering and then drops back down.

Lowering to 200kbps in the phone browser does not seem to affect playback/buffering.

I appreciate the help!
noipod
 
Posts: 21
Joined: Sun Aug 21, 2011 9:37 pm

Re: Optimizing Video Streaming

Postby GJ51 » Tue Sep 18, 2012 4:02 am

That's strange. A Core i7 should be able to crunch even a Blue Ray without maxing out.

I also have a favorite ffmpeg that I use that you can try here:

https://skydrive.live.com/redir?resid=A ... 0A32A0!203

It's named Videoffmpeg, just drop it into your transcode subdirectory and out "Video" in the front of your transcode string to see if that helps. Some versions of ffmpeg do a better job than others of utilizing multipl core CPU's.

You can also try the latest build from the ffmpeg site, I think it's Zeranoe.com that has the latest Windows static builds. Again, download and unzip the latest build for your OS and just dimp the ffmpeg.exe into the transcode subdirectory to test.

Looking at your hardware, the only bottleneck I can see would be the upload speed from the server, but if your network isn't being heavily utilized, then you should be able to get 500kbps pretty easily as your phone has good download speeds.

Are you watching the CPU load on the server while doing the 4g playback to see the performance? How much ram do you have on the host? I've got a Core i7 desktop that barely whinces when I tested it for video on Subsonic when I first got into video transcoding which is why I find it odd that it could max out your hardware at 720p.

I'd suggest trying the latest static build first, then if there's no improvement, try my "Videoffmpeg" version. One difference may also be that I use the WAR version on Tomcat which does seem to perfom a bit better than the standard Windows version.

Keep me posted as I'm curious to see if we can pinpoint this for you.
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

Re: Optimizing Video Streaming

Postby noipod » Tue Sep 18, 2012 4:33 pm

Thanks!

I simply copy and pasted the latest static ffmpeg build (after unzipping) into the Subsonic transcode subdirectory. I deleted the previous version in the subdirectory. Did I need to do anything else to "activate" the change? No noticeable improvement. CPU load seems to hover around 10%, then intermittently jump to 100% at times. I need to troubleshoot this better and rule out other processes that may be overloading the CPU. I have 4GB RAM on the host.

I have not tried the Videoffmpeg yet. Can you clarify what you meant: "...just drop it into your transcode subdirectory and out "Video" in the front of your transcode string..."

I'll try a bit more when I get to the host location (just remotely logging in now).

I appreciate the input.
noipod
 
Posts: 21
Joined: Sun Aug 21, 2011 9:37 pm

Re: Optimizing Video Streaming

Postby GJ51 » Tue Sep 18, 2012 5:52 pm

I don't think you need to do anything else, but it might be worth stopping and restarting the subsonic service just to be sure that the change is effective.

If you want to try the Videoffmpeg version, just download it and put it in the transcode subdirectory. Once there you can switch from the ffmpeg you just downloaded by a minor alteration of the transcoding string.

Your default should be:

ffmpeg -ss %o -i %s -async 30 -b %bk -r 23-.976 -s %wx%h -ar 44100 -ac 2 -v 0 -f flv -vcodec libx264 -preset fast -threads 0 -

this calls ffmpeg.exe in the transcode directory to do the work.

If you also have a file in the same directory named Videoffmpeg, you can just change the transcode string to:

Videoffmpeg -ss %o -i %s -async 30 -b %bk -r 23-.976 -s %wx%h -ar 44100 -ac 2 -v 0 -f flv -vcodec libx264 -preset fast -threads 0 -

To use the other version of ffmpeg to do the transcoding. To switch back, just delete "Video" at the front of the string to then go back to calling the original ffmpeg file.

I use 3 versions of ffmpeg for testing and tuning. One is the current ffmpeg release jsut named ffmpeg.exe, then I have a version that I like for Audio named Audioffmpeg, and the previously mentioned Videoffmpeg. All 3 are in the transcode directory which makes it easy to switch between the 3 versions of ffmpeg for testing and tuning specific uses in Subsonic.

Credit for the idea goes to Bushman4 when my lightbulb didn't go off on its own.
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

Re: Optimizing Video Streaming

Postby noipod » Tue Sep 18, 2012 10:54 pm

Thanks. Sorry, but you might have to walk me through this one:

When I go to Settings>Transcoding in the SS browser, my default string is (I deleted the original ffmpeg file and replaced with the latest static ffmpeg build):

ffmpeg -ss %o -i %s -async 1 -b %bk -s %wx%h -ar 44100 -ac 2 -v 0 -f flv -vcodec libx264 -preset superfast -threads 0 -

I downloaded the videoffmpeg file and put in the transcode subdirectory.

I'm not sure what I should do from this point as my current ffmpeg string differs from what you are listing below?

I'm going to play around a bit more when I have some time. Please advise if you have other recommendations.
noipod
 
Posts: 21
Joined: Sun Aug 21, 2011 9:37 pm

Re: Optimizing Video Streaming

Postby GJ51 » Tue Sep 18, 2012 11:49 pm

Just save your default string somewhere and replace the entry with:

Videoffmpeg -ss %o -i %s -async 30 -b %bk -r 23-.976 -s %wx%h -ar 44100 -ac 2 -v 0 -f flv -vcodec libx264 -preset fast -threads 0 -

Give it a go. If you still have the same issue you can always just cut and paste the original string back into the box.
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

Re: Optimizing Video Streaming

Postby noipod » Wed Sep 19, 2012 2:22 am

Thanks again.

I replaced the default string with the Videoffmpeg string but it just buffers indefinitely. When I tried to run the Videoffmpeg file it stated that the version was not compatible with my system. I'm running a 32 bit system. When I remove "Video" from the string, I am able to stream. Not a significant difference however from the default string.

Also, per this link: http://www.subsonic.org/pages/transcoding.jsp

"Is the transcoder activated for your player (in Settings > Players)?"

I don't think this is a problem since I only have one video transcoder listed in settings>transcoding, but...

Any ideas? Thanks for the patience.
noipod
 
Posts: 21
Joined: Sun Aug 21, 2011 9:37 pm


Return to Help

Who is online

Users browsing this forum: No registered users and 31 guests