question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Codec order preference for Video and Audio tracks

See original GitHub issue

Have you read the FAQ and checked for duplicate open issues? Yes

Is your feature request related to a problem? Please describe.

For dash manifests with multiple codecs for audio and video, Shaka player currently chooses the lowest bitrate bandwidth codec. I would like to have the ability to override that by sending an array of codecs to the shaka config.

Describe the solution you’d like I would like the ability to pass an array of codecs that I want Shaka player to consider as my preference when choosing a codec. videoCodecPreference: ['hevc', 'avc', etc] audioCodecPreference: ['ac-3', 'mp4a.40.2', etc]

Describe alternatives you’ve considered For audio codec, I considered the preferredAudioChannelCount shaka config but there are times where the manifest does not provide AudioChannelConfiguration channel count so that config property does not work.

For video, I have not able to find an out of the box support in the current Shaka player to let me choose what video codec to use.

Additional context This is to be used on the Chromecast receiver where I will first check the canDisplayType method in the CAF Receiver SDK and then populate the codec preference array that will be passed to the Shaka player to choose.

It allows Chromecast users the ability to have a higher bitrate codec viewing and audio experience.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:32 (21 by maintainers)

github_iconTop GitHub Comments

3reactions
michellezhuoggcommented, May 14, 2021

Update: the code change is in review now and would be ready for testing soon 😃

3reactions
joeyparrishcommented, Oct 8, 2019

Today, you can force a particular resolution or bitrate through the tracks API (getVariantTracks(), selectVariantTrack()), but the list of tracks is fixed once we choose a codec.

We can definitely provide a way to specify a preference. Thank you both for explaining your use cases for me. This will definitely help.

This relates to our adoption of MediaCapabilities (#1391), which will open up additional ways for us to choose a codec (based on bandwidth, on smoothness, or on power efficiency). Having one more option to use an explicit preference list will be relatively simple to add at that stage.

This also relates to our adoption of codec switching (#1528), which will allow us to avoid choosing a specific codec if the platform will allow us to adapt between codecs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Codec order preference for Video and Audio tracks #2179
For audio codec, I considered the preferredAudioChannelCount shaka config but there are times where the manifest does not provide ...
Read more >
Codec Preference Lists - Cisco
This chapter describes how to negotiate an audio codec from a list of codec ... A codec voice class is a construct within...
Read more >
Understanding Video File Types: Codecs, Containers, and ...
Curious about which video file type will work best for you? See the differences between file types such as Codecs, Containers, and outputs....
Read more >
Web audio codec guide - Web media technologies | MDN
Voice recording and playback usually needs to be low-latency in order to synchronize with video tracks, or in order to avoid cross-talk or...
Read more >
Managing Codecs | Twilio
Hence, for a multimedia communication to take place, the parties must support at least one shared codec. There are many audio and video...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found