INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Media server connection speed  (Read 1632 times)

ajp_anton

  • Junior Woodchuck
  • **
  • Posts: 57
Media server connection speed
« on: January 21, 2021, 03:21:29 pm »

I'm trying to stream my library over the internet, but I'm having trouble with high bitrate content. The issue doesn't seem to be about speed however, but latency.

I'm using a test clip encoded at 20Mbit/s.

Through my 100Mbit fiber connection, even when artificially limiting its speed to 30Mbit/s in the router, the video plays flawlessly. Ping to the server is 9ms.
Through my 100Mbit phone connection, the connection speed varies between 70 and 100Mbit/s, but ping is at 18ms and the video plays at half speed and the audio stutters to match it. Decoder queue in madVR is at 0-1.

The phone connection can handle videos at up to around 13Mbit/s, but more than that and it starts to stutter.

What could be the problem here?
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: Media server connection speed
« Reply #1 on: January 21, 2021, 03:59:18 pm »

By "phone connection", I assume you're connecting to the server via your cell phone, and not an ADSL phone line.
Can you describe your setup/connectivity in more detail?

- what is the upload speed of your server?
- what type of plan do you have, is it 4G/LTE?
- how are you testing speed? If you're testing on your ISPs site you'll get unrealistic speeds.

18ms should be fine. The issue is more likely about upload bandwidth or QoS from your ISP. 20Mbps streaming is a lot for 4G/LTE. Most FullHD TV channels operate at 2-4Mbps, even on cable connections... edit: this is outdated. It seems that modern HDTV broadcasts use around 10 to 20 Mbps.
Logged

wer

  • Citizen of the Universe
  • *****
  • Posts: 2640
Re: Media server connection speed
« Reply #2 on: January 21, 2021, 04:03:05 pm »

Your "100Mbit phone connection" is WiFi or cellular.

But which is it?  WiFi, you control. Cellular, your carrier controls, and they might be throttling you or dropping packets. A connection through your phone is not going to be great.

You don't mention what device you're actually playing on. Are you playing on the phone, or on a computer that is using the phone as a WiFi hotspot?  Or are you using bluetooth to tether the phone to the PC?

Your MC server cannot tell how the client is getting its connectivity. The full path from server to playback device can either handle the data stream without errors or it can't.  I would never expect to be able to consistently stream a 30mbps video over the data connection my phone gets.

There could be lots of problems, but your post doesn't have some of these specifics.  It would be helpful if you could provide more detail on exactly what you're doing and how all the different links in the connectivity chain are provisioned. 

Logged

ajp_anton

  • Junior Woodchuck
  • **
  • Posts: 57
Re: Media server connection speed
« Reply #3 on: January 21, 2021, 11:30:28 pm »

By "phone connection", I assume you're connecting to the server via your cell phone, and not an ADSL phone line.
Can you describe your setup/connectivity in more detail?

- what is the upload speed of your server?
- what type of plan do you have, is it 4G/LTE?
- how are you testing speed? If you're testing on your ISPs site you'll get unrealistic speeds.

18ms should be fine. The issue is more likely about upload bandwidth or QoS from your ISP. 20Mbps streaming is a lot for 4G/LTE. Most FullHD TV channels operate at 2-4Mbps, even on cable connections... edit: this is outdated. It seems that modern HDTV broadcasts use around 10 to 20 Mbps.
Server is in my parents' house with 1/1Gbit fiber connection. My home has 100/10Mbit fiber. And my phone has 100/50Mbit 4G/LTE.

I'm testing the speed using
- speedtest.net with single connection, and choosing the server to be my media server's ISP.
- speedtest.net, but connecting through a VPN on the media server (it's also running a VPN server).
- iperf to the media server
These all give identical results. Home fiber is rock solid at 100Mbit/s download (10Mbit/s up) and 9ms ping, phone varies 70-100Mbit/s download (40-50Mbit/s up) and 18ms ping.

Speedtesting the server to my home ISP results in about 900Mbit/s both down and up.
Logged

ajp_anton

  • Junior Woodchuck
  • **
  • Posts: 57
Re: Media server connection speed
« Reply #4 on: January 21, 2021, 11:43:00 pm »

Your "100Mbit phone connection" is WiFi or cellular.

But which is it?  WiFi, you control. Cellular, your carrier controls, and they might be throttling you or dropping packets. A connection through your phone is not going to be great.

You don't mention what device you're actually playing on. Are you playing on the phone, or on a computer that is using the phone as a WiFi hotspot?  Or are you using bluetooth to tether the phone to the PC?

Your MC server cannot tell how the client is getting its connectivity. The full path from server to playback device can either handle the data stream without errors or it can't.  I would never expect to be able to consistently stream a 30mbps video over the data connection my phone gets.

There could be lots of problems, but your post doesn't have some of these specifics.  It would be helpful if you could provide more detail on exactly what you're doing and how all the different links in the connectivity chain are provisioned.
My phone uses cellular, as Wifi wouldn't really be a phone connection. In fact I never connect my phone to wifi as cellular usually works better. I've never experienced any throttling, and every test I've made gets more than enough speed.

All my test were made on my laptop, the only thing I changed was how it connects to the internet:
Laptop <wifi> router <fiber> <internet> Server: speed 100Mbit/s, works flawlessly.
Laptop <wifi> router set up to limit the speed <fiber> <internet> Server: speed 30Mbit/s, works flawlessly.
Laptop <wifi> phone <4G/LTE> <internet> Server: speed >70Mbit/s, stutters horribly.
Laptop <USB> phone <4G/LTE> <internet> Server: speed >70Mbit/s, stutters horribly.

All speeds are measured using the methods in the previous post.

Also worth mentioning is that my home fiber and my phone 4G/LTE plan have the same ISP.
Logged

wer

  • Citizen of the Universe
  • *****
  • Posts: 2640
Re: Media server connection speed
« Reply #5 on: January 21, 2021, 11:51:00 pm »

The experience you're describing is exactly what I would expect when trying to stream high bitrate content across the cellular network.

Speedtest.net net is not a reliable indicator for this sort of thing.

How your client gets its internet connection is nothing MC can detect or control.  If you want reliable streaming over cellular, I suggest you transcode to a lower bitrate.
Logged

ajp_anton

  • Junior Woodchuck
  • **
  • Posts: 57
Re: Media server connection speed
« Reply #6 on: January 21, 2021, 11:59:59 pm »

The experience you're describing is exactly what I would expect when trying to stream high bitrate content across the cellular network.

Speedtest.net net is not a reliable indicator for this sort of thing.

How your client gets its internet connection is nothing MC can detect or control.  If you want reliable streaming over cellular, I suggest you transcode to a lower bitrate.
Is that just something you assume is always true? Because I haven't seen any proof of why my cellular connection would fare worse than a bandwidth-limited fiber connection. What tests should I run to see that it is worse?

You only dismissed speedtest.net, so does that mean the iperf results are acceptable?

edit: There have been situations where I've considered transcoding, however it doesn't support seeking or embedded subtitles, so it's not really an option.
Logged

wer

  • Citizen of the Universe
  • *****
  • Posts: 2640
Re: Media server connection speed
« Reply #7 on: January 22, 2021, 02:14:51 am »

Is that just something you assume is always true?
Well, I've been a networking professional for around 30 years now. I know a thing or two.

Because I haven't seen any proof of why my cellular connection would fare worse than a bandwidth-limited fiber connection.
Sorry, but there are some things that are just no longer necessary to spend time or effort proving, like fiber is better than cellular in terms of throughput and packet loss, or that the world is round.  The fact you're familiar with the phrase "Can you hear me now?" should say it all.  Companies that operate truly highly reliable networks don't have to advertise on the notion that your connection can remain stable long enough to make a call. If you don't want to take my word for it, there is ample technical documentation available on the internet so you can educate yourself on how the different technologies work and how the networks are operated, and then you can make your own assessment.

Another thing worth touching on is that you say you haven't experienced throttling.  Well, if you start streaming bluray-type content over cellular, which is what you're talking about, you'd better prepare to experience it. Because after you stream a few 30GB movies, your cellular provider is going to throttle you, regardless of whether you have "unlimited" data or not; they will cite you for abuse of their network. People who operate these networks don't like small numbers of people soaking up vast amounts of bandwidth and causing complaints from lots of other people, so those small number of people get dealt with. They can even disable your ability to act as a hotspot entirely. They may let you buy your way out of any penalty, but they're not going to rearchitect their network according to your needs.

You only dismissed speedtest.net, so does that mean the iperf results are acceptable?

It depends what kind of iperf test you ran. Are you an expert iperf user, or did you just run the default test?  iperf2 or iperf3? What command line options did you use? TCP? UDP? What target bandwidth? What packet size?  What direction? The right kind of iperf test can give a better indication as to the overall characteristics of your connection, yes.  At least at the moment you run the test, which is big caveat when you're talking about a shared network like your cell tower. But the best test of does a particular type of traffic work, whether it's VOIP, Videoconferencing, video streaming, or encapsulated CIFS, is to try and actually pass that type of traffic.

You did try to pass that type of traffic, and the results weren't good.

Another thing I'll mention, that perhaps isn't obvious to you, and is a caveat that both your internet connections share:  It's not just about the "speed" of the local internet connection you have. In order to stream 20-40Mbps for a couple of hours at a time, that much bandwidth has to be available not just at your client-side internet connection and your server side internet connection, but at every single hop in between constantly for the whole time. And probably on a single circuit too, because most operators will have fast switching enabled.  If the server side had 10Gbps fiber in California, and the client side had 10Gbps fiber in Florida, I still wouldn't bet on being able to consistently stream 20,30,40Mbps between them for 2 hours without an interrupted stream or pixelization due to packet loss.  There's a reason Netflix and Amazon don't stream at that rate.

I have a family member who streams (using Plex) to a house with a 100Mbps fiber connection, from a server hundreds of miles away that has a 1Gbps fiber connection.  But there's no WiFi or Cellular involved anywhere; everything is hardwired. Some nights, they can get away with streaming blu-ray without transcoding (so that will be between 18 and 40Mbps, depending on the movie).  Some nights they have to knock it down to 12Mbps.  It depends on what's going on on the internet.

edit: There have been situations where I've considered transcoding, however it doesn't support seeking or embedded subtitles, so it's not really an option.
Transcoding definitely is an option, if you approach it right. And it will lead to success, which since you don't live in Seoul, is not something I would expect for streaming unconverted bluray-type content over cellular.

Video streaming natively with MC is poor, and has problems. It's a market-trailing video streamer. But all the issues you describe can be overcome in any of several ways, such as pre-converting a movie to an appropriate streaming bandwidth with Handbrake, and including the necessary subtitles, either as a substream or burned in, or by using Plex as a client/server. Or by using a different client/server altogether for streaming. 

For example, I use a streaming server called Air Video HD, to stream video to my phone. It seeks better than Netflix, it does a fabulous job of adapting the bitrate to the sustained bandwidth available, and it deals with subtitles in multiple effective ways. It's so far ahead of MC in streaming it's not really comparable.  Plex doesn't do quite as well, but it is free and has clients for pretty much every platform, and is still way better than MC at streaming. It seeks ok (but this depends on the platform-specific client you use; for example the AndroidTV Plex Client is absolute garbage at seeking; the Apple client seeks ok), and handles subtitles ok (at least it makes them selectable).

I'm pointing out some options because I want to help you, and for you to ultimately be satisfied and happy with the solution you arrive at. And I'm afraid your expectations for cellular just aren't reasonable.  My advice is that you invest your effort in establishing a streaming workflow that functions well over the not-highly-reliable and intermittently-lossy cellular network that exists here in the US.  You're obviously free to disregard my advice and go your own way.

Anyway, I hope this helps.  Best of luck to you...
Logged

EnglishTiger

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 1088
Re: Media server connection speed
« Reply #8 on: January 22, 2021, 03:25:52 am »

Didn't the vast majority of ISP's agree to "throttle the internet", as in slow it down, back in March/April of last year to stop it from crashing out due to Excessive Use/Demand?

And Wer is quite right ISP's have a bad habit of placing a "very restrictive fair usage" clause in all their "Unlimited" contracts. As far as that lot are concerned the only thing that is "Unlimited" is their ability to charge people, especially one's who exceed the "Fair Usage" amount.
Logged
Apple Mac Mini Desktop Computer with M4 Pro chip with 12 core CPU and 16 core GPU: 24GB Unified Memory, 512GB SSD Storage, Gigabit Ethernet, 3 Thunderbolt5 + 2USBC ports.

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: Media server connection speed
« Reply #9 on: January 22, 2021, 03:33:51 am »

Agree with the above - streaming all that via cell network will get quickly get you into trouble.

Just for completeness sake (Wer's response has pretty much everything): I assume you're not using some cheap-ass phone, but you may still want to check if it can indeed decode that 20Mbps h264/HEVC stream in realtime, just to rule it out as the problem. Maybe set it up as an Access Point, connect your laptop to it and try the streaming to see if it also stutters. Even the Video App you're using could be a problem, try a couple of different video players on the phone. Or just copy one of the source files to the phone and try to play it from there, to rule out the network entirely.

If the phone/app is not the problem, it's likely to be QoS/Throttling from the cell network. It will only get worse after a few dozens GB of traffic.
Logged

ajp_anton

  • Junior Woodchuck
  • **
  • Posts: 57
Re: Media server connection speed
« Reply #10 on: January 22, 2021, 07:18:57 am »

Well, I've been a networking professional for around 30 years now. I know a thing or two.
I usually don't believe in blank statements, but I also listen to experts and such in the hope that they will provide an explanation.

Sorry, but there are some things that are just no longer necessary to spend time or effort proving, like fiber is better than cellular in terms of throughput and packet loss, or that the world is round.
I have no doubt that fiber is better than cellular. That's why I switched from cellular home internet into fiber, even though my home cellular used to be 3 and 5 times faster down and up. I know that cellular is less reliable, and I know why. My problem here is that my cellular connection clearly is capable of transmitting over 70Mbit/s of data. I use this connection all the time when not at home, and all downloads are always 5-10MB/s depending on location.
Another thing worth touching on is that you say you haven't experienced throttling.  Well, if you start streaming bluray-type content over cellular, which is what you're talking about, you'd better prepare to experience it. Because after you stream a few 30GB movies, your cellular provider is going to throttle you, regardless of whether you have "unlimited" data or not; they will cite you for abuse of their network. People who operate these networks don't like small numbers of people soaking up vast amounts of bandwidth and causing complaints from lots of other people, so those small number of people get dealt with. They can even disable your ability to act as a hotspot entirely. They may let you buy your way out of any penalty, but they're not going to rearchitect their network according to your needs.
I don't know where you live, but the cellular situation is a liiiittle bit different here in Finland... My monthly data usage over my phone has been up to 2TB, and nobody cares. In fact, when I was about to switch to fiber, they called me and begged me to stay. Even by offering a lower price in order to compete with the fiber. I told them I'm a heavy user with terabyte-level monthly usage, and they answered by happily offering an even faster cellular option. I've never heard of artificial throttling of any kind in this country, and data caps are almost never heard of. The only limits here is that we pay for speed, not for data.
Another thing I'll mention, that perhaps isn't obvious to you, and is a caveat that both your internet connections share:  It's not just about the "speed" of the local internet connection you have. In order to stream 20-40Mbps for a couple of hours at a time, that much bandwidth has to be available not just at your client-side internet connection and your server side internet connection
Well, my cellular connection is stable at >70Mbit/s for hours on end, by experience from downloading heavy stuff. Actually downloading the same 2h movie that it's incapable of streaming takes about half an hour, from the exact same server.

I'll get back and answer the rest later, as I'm not at home at the moment, and this post is already quite long.
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: Media server connection speed
« Reply #11 on: January 22, 2021, 10:45:24 am »

(...) here in Finland ...

Say no more :D
Logged

wer

  • Citizen of the Universe
  • *****
  • Posts: 2640
Re: Media server connection speed
« Reply #12 on: January 22, 2021, 01:23:44 pm »

...here in Finland...

Your situation, especially with regard to policies, is undoubtedly different. Congratulations on that. You'll benefit from the difference in population density, and competitive and regulatory environment. Considerations about throttling etc might not apply to you. I guessed you might be in the U.S.  I knew you weren't in South Korea.

Your situation with regard to performance, however, will regretfully be be limited by the technology and operating principles.

But all that aside, I won't argue with you about how or why your cellular performance wouldn't be adequate since your speed test and policies are so wonderful. The reality has been established.

You've already tested streaming 20Mbps video. You learned performance was unacceptable. If you were streaming a different bluray, your need would be twice that.

So you'll need choose an approach to correct the issue. Pick whichever one suits your inclination, preferences, and abilities best:

1. Reengineer the network to provide better throughput and lower packet loss to you during sustained periods of heavy use.

2. Reduce the bandwidth requirement to to consistently fit within the prevailing operating envelope.

3. Change the transmission and reception characteristics of the software system, either through replacement or reprogramming, to be more tolerant of and provide a better user experience with prevailing conditions.

4. Avoid the issues of streaming altogether by downloading the video first and then playing it locally.  This is essentially just a variant of #3 by manually making the buffer equal to the entire movie.

Good luck...
Logged

ajp_anton

  • Junior Woodchuck
  • **
  • Posts: 57
Re: Media server connection speed
« Reply #13 on: January 22, 2021, 02:24:02 pm »

I redid all my iperf tests. The cellular connection definitely has more packet losses/retries, but shouldn't the net TCP result be what matters? I mean, sure the speed might fluctuate, but there are buffers, right? It feels unnecessary to manually do a whole-movie buffer by downloading it first, because you'd assume that MC would have its own buffer?

TCP:
Code: [Select]
iperf3.exe -i 10 -c [remote server address] -t 600 -R -P 1

Fiber:

[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-600.01 sec  6.89 GBytes  98.6 Mbits/sec  309             sender
[  5]   0.00-600.00 sec  6.88 GBytes  98.6 Mbits/sec                  receiver

Cellular:

[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-600.12 sec  5.36 GBytes  76.8 Mbits/sec  1388             sender
[  5]   0.00-600.00 sec  5.36 GBytes  76.8 Mbits/sec                  receiver

UDP:
Code: [Select]
iperf3.exe -i 10 -c [remote server address] -t 600 -R -P 1 -u -b 20000000

Fiber:

[ ID] Interval           Transfer     Bitrate         Jitter    Lost/Total Datagrams
[  5]   0.00-600.04 sec  1.40 GBytes  20.0 Mbits/sec  0.000 ms  0/1027473 (0%)  sender
[  5]   0.00-600.00 sec  1.40 GBytes  20.0 Mbits/sec  0.171 ms  293/1027461 (0.029%)  receiver

Cellular:

[ ID] Interval           Transfer     Bitrate         Jitter    Lost/Total Datagrams
[  5]   0.00-600.07 sec  1.40 GBytes  20.0 Mbits/sec  0.000 ms  0/1071554 (0%)  sender
[  5]   0.00-600.01 sec  1.39 GBytes  20.0 Mbits/sec  1.120 ms  2650/1071494 (0.25%)  receiver


Transcoding definitely is an option, if you approach it right. And it will lead to success, which since you don't live in Seoul, is not something I would expect for streaming unconverted bluray-type content over cellular.
Well, transcoding using MC doesn't seem to work well because of the seeking and subtitle issues mentioned.

Video streaming natively with MC is poor, and has problems. It's a market-trailing video streamer. But all the issues you describe can be overcome in any of several ways, such as pre-converting a movie to an appropriate streaming bandwidth with Handbrake, and including the necessary subtitles, either as a substream or burned in, or by using Plex as a client/server. Or by using a different client/server altogether for streaming. 

For example, I use a streaming server called Air Video HD, to stream video to my phone. It seeks better than Netflix, it does a fabulous job of adapting the bitrate to the sustained bandwidth available, and it deals with subtitles in multiple effective ways. It's so far ahead of MC in streaming it's not really comparable.  Plex doesn't do quite as well, but it is free and has clients for pretty much every platform, and is still way better than MC at streaming. It seeks ok (but this depends on the platform-specific client you use; for example the AndroidTV Plex Client is absolute garbage at seeking; the Apple client seeks ok), and handles subtitles ok (at least it makes them selectable).
I mainly use MC because it works with madVR, but I guess I'll have to start looking for alternatives. I'll look into your suggestions, thanks.
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: Media server connection speed
« Reply #14 on: January 22, 2021, 02:42:07 pm »

Quote
I mainly use MC because it works with madVR, but I guess I'll have to start looking for alternatives. I'll look into your suggestions, thanks.

I use MC as the Library/frontend, but set it to play on External player - I use MPC-HC which is, in my opinion, far superior as a player (and nice looking with the Dark Theme). And it also uses MadVR. Just install the KLite Full codec pack and you're set.
Logged

ajp_anton

  • Junior Woodchuck
  • **
  • Posts: 57
Re: Media server connection speed
« Reply #15 on: January 22, 2021, 03:04:11 pm »

I use MC as the Library/frontend, but set it to play on External player - I use MPC-HC which is, in my opinion, far superior as a player (and nice looking with the Dark Theme). And it also uses MadVR. Just install the KLite Full codec pack and you're set.
Will using an external player help with what appears to be a buffer issue?
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: Media server connection speed
« Reply #16 on: January 22, 2021, 03:15:49 pm »

Won't know until you try it... different apps will have different buffering strategies. However... not sure how to set it up for streaming from an MC server, as I use it with the Server+Client+NAS all on the same network, so MPC-HC is opening the files directly via SMB.

I misunderstood before and thought you were using a cell phone as a player. I agree that using MC on a laptop with that LTE connection shouldn't result in stuttering - your iPerf results aren't bad at all, seems more than enough for your needs.

I also found this old post (which might not work anymore) - you can hack the LAV Splitter to increase the streaming buffer size. This should work for MC as well, as it also uses LAV splitter:
https://superuser.com/questions/842203/how-to-make-mpc-hc-to-cache-more-aggressively

EDIT:
I just checked all my copies of LAVSplitter.ax and none of them match the hex pattern on that hack, so it no longer works.
However, perhaps you can check your LAV Splitter options (in MC Custom mode), which do have some adjustable settings for max buffer size and stream analysis time. Increasing the max number of packets in queue might be helpful.
Logged

lepa

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2033
Re: Media server connection speed
« Reply #17 on: January 22, 2021, 04:44:35 pm »

I can try also this when I have little time. So client PC using cellular network. I have feeling that this has been fine when client and server are both on windows. JRemote/chromecasting been more troublesome when network speed has been varying during streaming.

Also I thought that subtitle selection works when client is also MC on PC even when transcoded. Might be that it needs to be embedded to mkv though... seems to be burned
Logged

lepa

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2033
Re: Media server connection speed
« Reply #18 on: February 12, 2021, 09:06:19 am »

For me it seems that slow speed is somehow connected MC dealing with machines which are not in same LAN. While testing new Share feature I could only get constant ~10mbps upload speed from MC to my phone while e.g Foobar2000 & BubbleUPN combo resulted ~30mbps for the same file and sending same file to signal I got 100mbps maximum speed.

BTW JRemote2 now supports selecting audio & subtitle source
Logged
Pages: [1]   Go Up