Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

h264 profile and level check #68

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DeFiYaco
Copy link
Contributor

@DeFiYaco DeFiYaco commented Dec 19, 2020

  • script checks h264 profile and level
  • config does not need .sh extension since there are only variables inside

I will keep this PR as draft until I test with more videos and add more supported and unsupported profiles and levels.
Feel free to comment if you do not agree with some of my changes.

@DeFiYaco DeFiYaco force-pushed the feature-profile-check branch 3 times, most recently from 312c3ca to 2648884 Compare December 19, 2020 09:37
@DeFiYaco DeFiYaco changed the title Feature profile check h264 profile and level check Dec 19, 2020
@DeFiYaco DeFiYaco force-pushed the feature-profile-check branch 7 times, most recently from 2c85990 to 2c45158 Compare December 20, 2020 13:07
@pfrenssen
Copy link
Collaborator

Chromecast Ultra supports up to L5.2 I believe. We might need to dig up the official documentation to know exactly which version supports what.

chromecastize.sh Outdated Show resolved Hide resolved
@DeFiYaco
Copy link
Contributor Author

Chromecast Ultra supports up to L5.2 I believe. We might need to dig up the official documentation to know exactly which version supports what.

Yes, that is correct. I am slowly testing with different video formats just to be sure.
This is the reference: https://developers.google.com/cast/docs/media
I will update supported and unsupported formats in the script accordingly.

@pfrenssen
Copy link
Collaborator

Probably it is not needed to maintain both the SUPPORTED and UNSUPPORTED profiles. I think just listing the supported ones should be sufficient.

@DeFiYaco DeFiYaco force-pushed the feature-profile-check branch 2 times, most recently from 2489f90 to 89ca139 Compare December 21, 2020 19:48
@DeFiYaco
Copy link
Contributor Author

True, it will make maintaining easier in the future if we just list what is supported. That is changed now along with reverting config to the config.sh.

@DeFiYaco DeFiYaco marked this pull request as ready for review December 21, 2020 19:51
Copy link
Collaborator

@pfrenssen pfrenssen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've just been reading up on the supported formats and it seems to be much more complicated than I expected. The supported formats depend on the codec. For example the Chromecast Ultra supports level 5.1 for h265 and VP9, but not for h264. For h264 only level 4.2 is supported.

I've also seen in the VideoHelp forums that mediainfo apparently can return any kind of string in the "Format_Profile" field for certain codecs. This apparently even can be set manually by the person doing encoding. For example people encoding for specific devices can put strings such as "Sony PSP" or "iPhone 6" in the profile field. This doesn't necessarily mean that we need to re-encode these files. This is probably more rare though, and I am OK with forcing a re-encode of any file that cannot be resolved into a known version string.

Another problem is that the current whitelists support the high tier with profiles 3.1, but what about the main tier, and levels 1, 2, 2.1 and 3? I assume these are also supported and don't need to be re-encoded. This means should support formats such as [email protected]

The profiles themselves can get very complex. The list of profiles for h264 is quite extensive, going from Constrained Baseline Profile to Baseline, Extended, Main and a whole range of High profiles (ref. https://en.wikipedia.org/wiki/Advanced_Video_Coding#Profiles).

With h265 the situation is simpler but it uses strings such as Main [email protected]@High.

I think however that for practical purposes we can probably ignore the profile, it is mostly the level which is going to be important since this is limited by the performance of the decoder hardware.

So maybe we should just check the level. We can get it using a regular expression that matches on /@L(\d(.\d)?)/, and then we can define our matrix of supported levels as follows:

# Suggested options for Chromecast Ultra.
#MAX_LEVELS=('AVC:4.2' 'HEVC:5.1', 'VP9:5.1')

README.md Outdated Show resolved Hide resolved
default config and gitignore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants