shaka-project / shaka-streamer

A simple config-file based approach to preparing streaming media, based on FFmpeg and Shaka Packager.
https://shaka-project.github.io/shaka-streamer/
Apache License 2.0
198 stars 62 forks source link

fix: Do not encode in mono by default #145

Closed joeyparrish closed 10 months ago

joeyparrish commented 10 months ago

Encoding in mono feels like it is a waste for most stereo or surround content. Let's only do stereo and surround by default.

mariocynicys commented 10 months ago

Let's only do stereo and surround by default.

What if the input's channel layout is already mono? We won't be able to up-mix it!

Also, hard coding the layouts like that will cause the streamer to fail if the user provides a bitrate config file that doesn't have the labels stereo or surround:

audio_channel_layouts:
  mono:
    max_channels: 1
    bitrates:
      aac: '64k'
      opus: '32k'
  two: # not stereo
    max_channels: 2
    bitrates:
      aac: '128k'
      opus: '64k'
  six: # not surround
    max_channels: 6
    bitrates:
      aac: '192k'
      opus: '96k'

I think the way it is right now (using all the bitrate config layouts) is the most general and robust. And it's only triggered if we didn't specify channel_layouts in the pipeline config anyways.

joeyparrish commented 10 months ago

I tend to think if the defaults aren't good for me, maybe they aren't good for others... But perhaps I'm overindexing on myself on this one. Thanks for the feedback!