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
199 stars 62 forks source link

Add support for ac3 and ec3 #37 #69

Closed ans-negi closed 3 years ago

google-cla[bot] commented 3 years ago

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

ans-negi commented 3 years ago

37

ans-negi commented 3 years ago

@googlebot I signed it!

joeyparrish commented 3 years ago

This looks good to me, but I have one question: On what did you base the bitrate choices for ac3 and ec3?

ans-negi commented 3 years ago

@joeyparrish Hey they were recommended bitrates at FFmpeg site , so from there I took stereo values. And I realised for Opus and aac there was a relation between stereo and surround values, so to calculate surround value for ac-3 and ec-3 I used same formula (160)*(6)/(2)(2) == 240k

avelad commented 3 years ago

I would like more to take the values that Apple gives for Reference in HLS. https://developer.apple.com/documentation/http_live_streaming/hls_authoring_specification_for_apple_devices

image

What do you think?

joeyparrish commented 3 years ago

@avelad, how about this: We adjust the defaults to be more similar to Apple's recommendations, and we also create a explicit bitrate config file that exactly matches what Apple suggests, including for video.

Here's a compromise between our existing values (extrapolated from Google internal recommendations) and Apple's recommendations:

Num. Channels AAC Bitrate Opus Bitrate AC3 Bitrate EAC3 Bitrate
2 128 64 192 96
6 256 128 384 192

@avelad, @ans-negi, if y'all both agree, let's use the value above as the default.

avelad commented 3 years ago

I agree!

ans-negi commented 3 years ago

@joeyparrish Yeah that makes sense, I have updated the defaults.

joeyparrish commented 3 years ago

Thanks for your contribution!