damontecres / StashAppAndroidTV

Android TV App for Stash
GNU Affero General Public License v3.0
84 stars 4 forks source link

Allow the client device to decide whether transcoding is needed #273

Closed damontecres closed 4 months ago

damontecres commented 4 months ago

The server will provide a stream labelled "Direct stream", but this is aimed towards the web UI player. In some cases, an Android TV device can direct play the video even when the web UI cannot.

This PR changes the direct play vs transcode decision. The app will check what video/audio codecs the device reports as able to decode. If the video has a supported video codec and supported audio codec, the app will attempt to play the video directly no matter what.

A user can still force transcoding (#61) if needed. This PR also adds the ability to force a direct play as well.

In advanced settings, a user can specify specific codecs which should be considered as supported for direct play even if the device doesn't report them as supported (ac3 and pcm audio is a good example of this). Several audio codecs are included in this list by default, but can be removed if needed.

That said, the attempt is just that, an attempt. Since the server does not expose finer grained parameters, such as H264 profiles/levels, these parameters are not considered in the decision. This means some videos may not actually direct play, but users can force the transcode in these situations.

Finally, there is an advanced setting to enable a debug overlay during playback which explains the decision to direct play vs transcode.

Closes #270

Related to #59, #232, & #233

Ref: