Jump to content

Video stuttering with DirectStream, fine with StreamCopy and Transcode


newb

Recommended Posts

Hi experts, please could you help me.

 

I am not sure whether this is an Android client issue or a server issue, so please be ar with me.

I have played with the LAN/WIFI bit rate and have found that whenever the client uses DirectStream to play a video, the video playback stutters while the audio is fine. I have done the following tests:

 

- Set a high bitrate in the client and played a movie, the video stream was copied (StreamCopy) while the audio was transcoded - the playback was great.

- Lowered the bitrate enough so that the video stream had to be transcoded - playback was great.

- Set a high bitrate again and played an episode from a TV series. Video and audio were streamed directly (DirectStream) - video playback was choppy while audio was fine.

- Lowered the client bitrate enough so that the video was transcoded - playback was fine (but the video quality was low).

 

I tried to play the same episode over the LAN using ES File Explorer and any video player app, playback was fine. Copying the episode to the device and playing it through any video player app also works great.

 

So the only scenario where video playback is choppy is when the video is streamed directly. This is a problem because this means that I cannot watch any TV series or any video that is streamed directly unless I lower the bitrate enough so that the video gets transcoded into a lower quality video stream than the original.

 

The above behavior also happens in the web client too, but as mentioned, I can play the videos fine from a network share using any other non-Media-Browser app.

 

Turning HSL on and off does not seem to make a difference.

 

Is there any advice you can give?

 

I would post logs but I do not think much is logged when the video is played back directly (DirectStream).

 

The device I am using is the Samsung Galaxy Note 10.1 2014 Edition, so it should have ample power to play anything thrown at it.

 

Thank you for any help that you can offer.

Edited by newb
Link to comment
Share on other sites

well it appears to be an issue of bitrate too high to sustain smooth playback. the es explorer test isn't applicable because it's playing over the lan file system.

Link to comment
Share on other sites

Thanks for the reply Luke.

 

Upon further investigation I am now convinced that this issue is actually not bitrate related.

 

I have a Samsung Galaxy S4 with the Android client installed and it can play episodes just fine regardless of the bitrate (it is currently set at 6mb/s). With my tablet the video stutters using the same settings. Only once I lower the bitrate on the tablet to less than 1mb/s is my test episode transcoded and then playback works fine. With the movie test however, I can set the bitrate to the maximum value possible and it still plays back flawlessly on the tablet. The issue appears to be specific to my new tablet...sigh.

 

I have performed further tests. I installed MX Player from the Play Store and used that as an external player for the Android client. There is a setting in MX Player to use HW+ decoding or not. With HW+ decoding disabled (this is the default setting) the video playback stutters. When I enable HW+ decoding, then playback is smooth. Both the Android client's internal player as well as the web client's player behave like MX Player without HW+ decoding. So I do have a workaround by using an external HW-decoding-enabled player, but this solution is not perfect since I lose playback tracking / resume with Media Browser.

 

If I try to play the test episode on my tablet via a network share I do not encounter the video stuttering, regardless of HW decoding setting. I mentioned this test in my previous post to highlight that the issue is not related to Wi-Fi speed or signal quality. The only way right now for me to reproduce the issue on my tablet is to play a video from Media Browser using DirectStream and use either the internal Android client player, web client or an external player without HW decoding. I would return this tablet to the store but I will need to reproduce the problem in store and right now I can't do that since I cannot take Media Browser Server with me.

Edited by newb
Link to comment
Share on other sites

Redshirt

When you direct stream, what codec/container are you typically using?

Link to comment
Share on other sites

Hi Redshirt,

 

Here is the media info that the web client displays for my test episode:

post-648-14058383866353_thumb.jpg

 

I have tv shows and movies that use H264 and it would appear that the tablet struggles to decode them when using DirectStream through Media Browser, but my phone does not have the same problem.

Link to comment
Share on other sites

Redshirt

The issue may actually be the high profile. If that's the case the issue will be resolved in the next client release. You can possibly verify if the tablet doesn't like high profile if you have a baseline profile video you can direct stream.

Link to comment
Share on other sites

Ok I have done further tests. In all of the tests below, my client bitrate was set to 6mb/s.

 

This played fine, both video and audio were transcoded, AVI:

post-648-14058567507431_thumb.jpg

 

The following played fine as well!? Notice that it is similar to the video in my previous post? The only difference is that with this video, StreamCopy was used for the video while the audio was transcoded, whereas in the video from my previous post, both video and audio used DirectStream:

post-648-14058570981275_thumb.jpg

The video was also an MKV file whereas the video from my previous post was an MP4.

 

Video playback stutters with the following (DirectStream, DirectStream, MP4):

post-648-14058574414288_thumb.jpg

 

The following plays fine (DirectStream, DirectStream, MP4):

post-648-14058576673156_thumb.jpg

Link to comment
Share on other sites

Redshirt

So based on that I'd say it is the high profile that causes the stutter. If you look at stock Androids supported media formats they only list baseline for h264. Some oems or carriers change the default codec support and add support for high profile or even other codecs. That's possibly why it plays fine on your s4 and not the tablet. Although it's hard to say as there is a bitrate variance between the last two h264 tests you provided.

 

Needless to say, I've fixed the bug that was allowing high profile to direct stream rather than forcing a transcode. It's just a matter of getting the next update far enough along to release it.

Link to comment
Share on other sites

I did want to do a baseline h264 test with a higher bitrate, but after spending over an hour trying to find a video with such parameters I settled on the video used in my last test since the profile of almost all of my h264 media appears to be high.

 

What confuses me though is my second test in my previous post: a high profile h264 encoded video which plays perfectly due to (in my opinion) the StreamCopy, which is triggered by the need to transcode the AC3 audio. Indeed I have an entire TV series in that format that appears to play perfectly on the tablet. So I do agree that the high profile h264 appears to be the cause of my issues here - I am not sure why there would be stuttering in DirectStream mode but not in StreamCopy mode.

 

Another confusing result is that if I play the videos via ES File Explorer over a network share, they play fine in any player - shouldn't the videos which stutter when played though media browser also exhibit this behavior when played over the network share?

 

In any event, thank you for your help Redshirt, it is appreciated.

 

I look forward to your new release.

Link to comment
Share on other sites

  • 2 weeks later...
ivoidwarranties

Needless to say, I've fixed the bug that was allowing high profile to direct stream rather than forcing a transcode. It's just a matter of getting the next update far enough along to release it.

Would it be possible to make that configurable -- the ability to direct stream videos with high profiles? I am using Media Browser on all my Android devices.... And all my videos are encoded using high profiles. I would like to avoid transcoding if possible....

 

 

Maybe an "Advanced" setting to disable transcoding altogether? A "use at your own risk" setting??

Edited by ivoidwarranties
Link to comment
Share on other sites

Redshirt

I haven't decided if I'm going to make it configurable or not. The default spec for the Android internal player is baseline only. Devices aren't guaranteed to play (or play well) high profile h264.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...