taligentx / LiveTVH.bundle

Live TV streaming with Plex and Tvheadend
GNU General Public License v3.0
105 stars 19 forks source link

Feature Request: Use separate Tags for Audio and Video Codecs #7

Closed mastacheata closed 6 years ago

mastacheata commented 7 years ago

I really like the idea of identifying codecs via tags in TVheadend. However of your combinations only the Mpeg2 one is useful to me.

We have MPEG2 with AC3 for 5.1 and MPEG2-Audio for Stereo in SD channels and have H264 with AC3 for HD channels (there's different channels for 5.1 and Stereo, but all encoded in AC3)

As maintaining a list of all the different possible combinations is quite cumbersome, I'd like to suggest dynamically setting the Audio/Video codecs depending on the Tags instead.

Off-Topic: This is one of the first Plex Plugins I've stumbled across that actually looks maintainable by external people. Most of the others have so mangled up code that most likely only the original author could understand it.

taligentx commented 7 years ago

Hi @mastacheata,

As maintaining a list of all the different possible combinations is quite cumbersome, I'd like to suggest dynamically setting the Audio/Video codecs depending on the Tags instead.

Thanks for the suggestion! That shouldn't be difficult to implement, though at the moment the only functional purpose for specifying codecs is to encourage direct streaming for H264/AAC-only clients (Plex Web, iOS, etc). So far, that means that the only necessary tags are H264-AAC and H264-MP2 and the rest are purely decorative.

Otherwise, clients that can direct play (Plex Media Player, OpenPHT) already do so even without any codecs being specified and correctly handle H264, MPEG2, AAC, AC3 5.1 and AC3 2.0 streams - the only benefit to specifying a codec is aesthetic - the pre-play screens will show the AC3 media flag and number of channels, for example, but the actual playback is unaffected by any codec setting.

This could be different for console, smart TV, WD TV, and nVidia Shield clients - I'll need feedback on what's happening with playback on these platforms to see if they need a more complete media profile to direct play/direct stream.

This is one of the first Plex Plugins I've stumbled across that actually looks maintainable by external people. Most of the others have so mangled up code that most likely only the original author could understand it.

Thank you! This is really nice to hear as I don't have a background in software development and used this plugin as an excuse to learn Python. Any feedback on coding style/efficiency issues is always appreciated!

-Nikhil

mastacheata commented 7 years ago

I've tried to use this on an Amazon FireTV (1st gen box) and always run into problems with my NAS box not really having enough horse power to do on the fly transcoding of live video. (It's got way better performance than the ARM or MIPS boxes, but since the embedded Intel Atom lacks the graphics processor it's not really powerful enough for these tasks either)

taligentx commented 7 years ago

I've added H264-AC3 as a valid channel tag to the develop branch for now, let's see if the FireTV will direct stream.

Parsing for separate tags should be straightforward so I'll take a look for the next release.

taligentx commented 7 years ago

The current develop branch now supports separate video and audio tags (and also combined video-audio tags for convenience). Let me know if this works out!