Jump to content

Why the server/transcoder doesn't detect the hardware capabilities of a given device?


Richard Branches

Recommended Posts

Richard Branches

Currently, the server transcode media if the target device doesn't support a particular video or audio codec, but it doesn't detect if the device cannot play a particular video fluently, for example:

 

I have an Android budget phone, it has a MediaTek MT6580 @ 1.30 Ghz, 1 GB of RAM (940 MB Total), the screen resolution is 480x854 pixels and Android 7.0.

 

I have a movie in MKV container, the video codec is VC-1 with a resolution of 1920x1080p, an overall bitrate of 18,8 Mbps and the audio codec is AC3 5.1.

 

With the quality set to "Auto" in settings, this movie plays directly on my phone, but it doesn't play fluid, it stutter a lot, it was unwatchable, but this doesn't have to do with the wifi speed because I copied this movie directly to the memory of the phone and it wasn't fluid either.

 

What I did afterwards was to change the quality manually, testing the available bitrates one by one in descendent order, starting with the quality smaller than the one in the video:

 

1080p - 15 Mbps: Didn't work

 

1080p - 10 Mbps: Didn't work

 

1080p - 8 Mbps: Didn't work

 

1080p - 6 Mbps: Didn't work

 

1080p - 5 Mbps: Didn't work

 

1080p - 4 Mbps: Worked

 

So the only quality that worked without any issues (stutter, pixelated video, etc.) was 1080p - 4 Mbps, but there is one problem, it changes the quality globally, so if I play another video I have to set the quality again to "auto" in settings or during playback because not all the videos play fluid with the same quality, I tested others where I had to set different qualities.

 

It's important to note this applies only to the local network and it only applies to HD videos because this phone in particular plays SD videos with no issues.

 

So the questions to the Emby team are:

 

 

Is this something that can be fixed in the future or is it very hard to implement?

 

Have you ever consider something like this?

 

I know the most obvious answer to this question is to buy a new phone with a better processor and memory but that's not the point, the idea is to have a better understanding about the transcoding process with a case like this.

Edited by delacosta78
Link to comment
Share on other sites

Your issue most likely is the fact THIS movies used the VC-1 codec.  This codec is very CPU intensive for ffmpeg to transcode since VC-1 is single thread vs multi threaded like H.264.

 

Your device probably can decode H.264 in HW but not VC-1.

 

VC-1 just doesn't get a lot of love. :)

 

What I would suggest is to try and convert this file offline to an MP4/H.264 based file then try it again.  A lot of people running media servers will not add VC-1 based files to our libraries because of the lack of clean usability of them.  They aren't widely supported by many devices and give ffmpeg problems.

 

Hopefully you don't have many VC-1 based files in your libs and can convert them over.

 

Carlo

Link to comment
Share on other sites

Richard Branches

Your issue most likely is the fact THIS movies used the VC-1 codec.  This codec is very CPU intensive for ffmpeg to transcode since VC-1 is single thread vs multi threaded like H.264.

 

Actually no, the issue wasn't only with VC-1 codec, in my post I said I tested other videos although I didn't say what type, so they were h.264 and I had to lower the bitrate to have a suitable playback, the problem is not the codec itself but the bitrate.

 

Your device probably can decode H.264 in HW but not VC-1.

 

Like I said in my post, the video plays directly, it seems the device has VC-1 support or the emby app has a software decoder for it.

 

What I would suggest is to try and convert this file offline to an MP4/H.264 based file then try it again.  A lot of people running media servers will not add VC-1 based files to our libraries because of the lack of clean usability of them.  They aren't widely supported by many devices and give ffmpeg problems.

 

I have another movie in h.264 codec with a very high bitrate and it didn't play smoothly, I just mentioned the movie with the VC-1 codec as an example and not as the main reason for my post, like I said, the issue is with HD videos and their bitrate regardless of the codec they use.

Edited by delacosta78
Link to comment
Share on other sites

Hi.  It would be virtually impossible for us to cross-reference all potential video content with all potential devices and their capabilities.

Link to comment
Share on other sites

Richard Branches

Hi.  It would be virtually impossible for us to cross-reference all potential video content with all potential devices and their capabilities.

 

I understand, in that case, a custom bitrate should be saved only for that particular video in that particular device, so when resuming playback, it retains the same bitrate while keeping the "auto" setting untouched, I'm gonna create a feature request for this. Thanks anyway.

Link to comment
Share on other sites

This is a bit confusing.  So you are saying this (or some) videos requires the quality to be brought down to 1080 4Mbps while other videos will play at a higher rate?

 

Something doesn't quite sound right about this.  I bet if you dig deeper you will see there is a common thing between these such as audio codec, bitrate, codec, container that the problem files have in common.

 

You also might be better off using 720 resolution for the transcoding as well since anything more than that is being wasted on this device.  You should find a 4Mb 720 file will have more "useful" information in it than the 1080 file since ever pixel is displayable.

 

Out of curiosity do you have any MP4/H.264/AAC files that won't play on this device?

Link to comment
Share on other sites

Richard Branches

This is a bit confusing.  So you are saying this (or some) videos requires the quality to be brought down to 1080 4Mbps while other videos will play at a higher rate?

 

No, no, no, the 1080p 4Mbps was for the video I used a an example, other videos need to be brought down to another quality, which depends on the video itself, I never said I had to raise the bitrate for other videos to play smoothly, please correct me if that's what I meant.

 

 

Something doesn't quite sound right about this.  I bet if you dig deeper you will see there is a common thing between these such as audio codec, bitrate, codec, container that the problem files have in common.

 

All my video files are in MKV container, obviously they contain different codecs and bitrates, I don't have any problems with audio codecs but with video codecs in which the bitrate is higher than my device can handle.

 

You also might be better off using 720 resolution for the transcoding as well since anything more than that is being wasted on this device.  You should find a 4Mb 720 file will have more "useful" information in it than the 1080 file since ever pixel is displayable.

 

With the VC-1 codec, the movie played smoothly at 1080p - 4Mpbs, but I tested another video, the file is an h.264 in 1080p resolution with a bitrate of 5.1 Mbps, I had to brought down the quality to 720p 2Mbps to play it smoothly. I tested more videos and noticed some played smoothly at 1080p while others at 720p. I don't see this as a problem but I think you are right at saying that it's better to select a fixed bitrate to transcode everything above the device cannot handle.

 

Out of curiosity do you have any MP4/H.264/AAC files that won't play on this device?

 

 I have different h.264 videos with AAC but like I said, the problem is not with the codecs but the bitrate, so what I'm gonna do is to test different videos to find the maximum bitrate the device can handle and then select a fixed bitrate in settings, so everything above that will be transcoded while everything below will play directly. I don't know why I didn't come up with this idea before, probably because I prefer "auto" to do everything for me  ^_^

Link to comment
Share on other sites

Richard Branches

You also might be better off using 720 resolution for the transcoding as well since anything more than that is being wasted on this device.  You should find a 4Mb 720 file will have more "useful" information in it than the 1080 file since ever pixel is displayable.

 

All right, after testing different videos the best bitrate for the device is 720p - 1 Mbps but there is one problem though, It transcodes everything with a bitrate higher than 1Mbps, it's not taking into account the resolution of the video, so videos at 640x480 with a bitrate higher than 1Mbps are getting transcoded, I'm going to create a bug report about this.

Link to comment
Share on other sites

That's not a bug. The bitrate value is the most important thing. You set 1 mbps. Anything higher, no matter the resolution, will transcode.

Link to comment
Share on other sites

Richard Branches

That's not a bug. The bitrate value is the most important thing. You set 1 mbps. Anything higher, no matter the resolution, will transcode.

 

Thanks for clarifying that, then a 1.2Mbps is needed between 1.5Mbps and 1Mbps, some HD videos are not playing smoothly at 1.5Mbps and the device freezes but if I set it to 1Mbps many SD videos are getting transcoded when they shouldn't because they play fine directly.

Link to comment
Share on other sites

Richard Branches

Right, it's obviously a balancing act.

 

Should I create a "feature request" or are you going to take this into account from here?

Link to comment
Share on other sites

Richard Branches

To request what?

 

The 1.2Mbps option for quality setting.

Link to comment
Share on other sites

The 1.2Mbps option for quality setting.

No, because bitrate isn't really your problem. The problem lies elsewhere, most likely with an under powered device that isn't currently able to play your standard videos.

 

Before going down this rabbit hole you should try checking hardware setting and/or using an external player on your mobile phone.

You're already at ridiculously low rates and there is something else causing your problems.

 

BTW, have you checked to see if your phone is using WIFI or the cellular network? If WIFI is it 2.4 or 5GHz?

Link to comment
Share on other sites

Richard Branches

No, because bitrate isn't really your problem. The problem lies elsewhere, most likely with an under powered device that isn't currently able to play your standard videos.

 

The problem lies in my phone, because it's a budget phone, I said that in this post description.

 

BTW, have you checked to see if your phone is using WIFI or the cellular network? If WIFI is it 2.4 or 5GHz?

 

This concerns only to local network playback, external wifi and cellular network it's a different story but I don't have problems with that either, except with music playback which is not getting transcoded, there is already a post for that issue, I guess devs are working on it.

Link to comment
Share on other sites

Richard Branches

To close this topic, I'm also a Plex user and guess what? I found out today the server has what I'm looking for and I didn't know it, the app has something called "convert automatically", it adapts the video depending on the network connection but also it seems to adapt the video to the hardware of my phone!, I hope you guys investigate a little further because it works, it really works.

 

I tested different videos, for example, see this screenshots:

 

This video has a resolution of 1912 x 1072 and it's too heavy for my phone, it stutter a lot, sometimes the app freezes

 

5aa37c351ca77_Screenshot01.png

 

Then I tap on the cog icon on the right and select the option "convert automatically" from the quality setting

 

5aa37c813e57f_Screenshot02.png

 

The video resolution start to adapt depending on the connection speed or hardware speed

 

5aa37cf60fb5e_Screenshot03.png

 

5aa37d1b9bda5_Screenshot04.png

 

This is still in beta and the only problem I see so far is we have to select it manually for every video, at least it does what I wanted.

Link to comment
Share on other sites

Question Luke,

Doesn't the auto just pick a resolution/bitrate to use from the standard set?

 

The Plex setting he's talking about is ABR (adjustable bitrate) that dynamically changes the resolution and bitrate as needed during playback. Actually works pretty well on cell networks and WIFI that deteriorate as you get farther from the tower/antenna and gets stronger as you get closer.

 

Does the Emby AUTO setting work the same way dynamically adjusting the max bandwidth it can use?

Link to comment
Share on other sites

Richard Branches

Question Luke,

Doesn't the auto just pick a resolution/bitrate to use from the standard set?

 

The Plex setting he's talking about is ABR (adjustable bitrate) that dynamically changes the resolution and bitrate as needed during playback. Actually works pretty well on cell networks and WIFI that deteriorate as you get farther from the tower/antenna and gets stronger as you get closer.

 

Does the Emby AUTO setting work the same way dynamically adjusting the max bandwidth it can use?

 

Just to clarify, the screenshots are based on local playback not external wifi...

Link to comment
Share on other sites

Richard Branches

I have an idea, what if "auto" could also detect the resolution of the screen and set the quality automatically based on that? for example, my phone has a screen resolution of 854 x 480 pixels, that means the best quality to play videos smoothly should be 480p - 1Mbps so everything above should be transcoded. This should help people with little knowledge about resolutions and bitrates, asking themselves what quality to use when the app does all the job for them.

 

That's what Youtube app does on my phone, the max resolution the app can go automatically is 480p.

Edited by delacosta78
Link to comment
Share on other sites

Richard Branches

I think the best solution to this problem with low powered phones or with phones with low screen resolutions like mine is to limit the available qualities in settings based on screen resolution:

 

Currently my phone shows 4K - 120 Mbps as the max quality in settings:

 

5aa4b6ec144a3_Screenshot01.png

 

Since my phone screen is limited to 480p then this is what my phone should display in quality settings, nothing beyond:

 

5aa4b7ba234a1_Screenshot02.png

 

This is what Youtube app detects and shows on my phone while playing a video, and this is what Emby on all mobile apps should display, auto and manual qualities the device support depending on screen resolution:

 

5aa4b84d09887_Screenshot03.png

 

This must apply to local playback and internet playback. on local playback, "Auto" should detect the resolution of my phone screen and work within that limit while on internet playback, "Auto" must take into account first the limit of the upload speed (0.5 in my case) and then the resolution of the screen and work within that limit.

Edited by delacosta78
Link to comment
Share on other sites

Richard Branches

Question Luke,

Doesn't the auto just pick a resolution/bitrate to use from the standard set?

 

The Plex setting he's talking about is ABR (adjustable bitrate) that dynamically changes the resolution and bitrate as needed during playback. Actually works pretty well on cell networks and WIFI that deteriorate as you get farther from the tower/antenna and gets stronger as you get closer.

 

Does the Emby AUTO setting work the same way dynamically adjusting the max bandwidth it can use?

 

ABR seems not only to dynamically change the bitrate by network connection but device capability as well, at least that's what it seems to do with my low power phone...

Link to comment
Share on other sites

Richard Branches

I have a question, why the Android TV app on the Xiaomi Mi Box is limited to 21Mb/s if "auto" is selected in settings? is it detecting the limitations of the device or you set that limit in the app code?

Link to comment
Share on other sites

I have a question, why the Android TV app on the Xiaomi Mi Box is limited to 21Mb/s if "auto" is selected in settings? is it detecting the limitations of the device or you set that limit in the app code?

 

We are limiting it to published specs in auto.  You are free to move it up if your find it works well in your environment.

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...