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

fix: refactor stream variants #91

Merged
merged 1 commit into from
May 29, 2023
Merged

fix: refactor stream variants #91

merged 1 commit into from
May 29, 2023

Conversation

TroyKomodo
Copy link
Member

@TroyKomodo TroyKomodo commented May 29, 2023

Proposed changes

Completes #86 bullet point 4

This change refactors how we store the stream variants and also sets up the transcoder for unit tests and cleans up the way transcoder invokes ffmpeg.

Previously we did some jank way of having variants and then variants that reference other variants which was really messy.
Now we have variants and transcode states. Variants can either reference 1 or more transcode states.
The HLS manifest is then created to comprise these changes

#EXTM3U
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="595eaf20-9b81-4e6a-8767-5e48d620d9e1",NAME="595eaf20-9b81-4e6a-8767-5e48d620d9e1",AUTOSELECT=YES,DEFAULT=YES,URI="595eaf20-9b81-4e6a-8767-5e48d620d9e1/index.m3u8"
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="adf09098-38ec-4447-a2b6-ff3735df4ac0",NAME="adf09098-38ec-4447-a2b6-ff3735df4ac0",AUTOSELECT=YES,DEFAULT=YES,URI="adf09098-38ec-4447-a2b6-ff3735df4ac0/index.m3u8"
#EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="d3c355b1-02b5-4ce7-b866-27c520c5c92e",NAME="d3c355b1-02b5-4ce7-b866-27c520c5c92e",AUTOSELECT=YES,DEFAULT=YES,URI="d3c355b1-02b5-4ce7-b866-27c520c5c92e/index.m3u8"
#EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="0f3bd47a-5a29-4dc6-af88-62ad3f1df7c0",NAME="0f3bd47a-5a29-4dc6-af88-62ad3f1df7c0",AUTOSELECT=YES,DEFAULT=YES,URI="0f3bd47a-5a29-4dc6-af88-62ad3f1df7c0/index.m3u8"
#EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="3a20175f-5bfb-400c-9aa2-358df5501052",NAME="3a20175f-5bfb-400c-9aa2-358df5501052",AUTOSELECT=YES,DEFAULT=YES,URI="3a20175f-5bfb-400c-9aa2-358df5501052/index.m3u8"
#EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="d08827ef-6aea-45c9-97b1-1608e3198b95",NAME="d08827ef-6aea-45c9-97b1-1608e3198b95",AUTOSELECT=YES,DEFAULT=YES,URI="d08827ef-6aea-45c9-97b1-1608e3198b95/index.m3u8"
#EXT-X-STREAM-INF:GROUP="opus",NAME="audio-only",BANDWIDTH=98304,CODECS="opus",AUDIO="595eaf20-9b81-4e6a-8767-5e48d620d9e1"
595eaf20-9b81-4e6a-8767-5e48d620d9e1/index.m3u8
#EXT-X-STREAM-INF:GROUP="aac",NAME="audio-only",BANDWIDTH=131072,CODECS="mp4a.40.2",AUDIO="adf09098-38ec-4447-a2b6-ff3735df4ac0"
adf09098-38ec-4447-a2b6-ff3735df4ac0/index.m3u8
#EXT-X-STREAM-INF:GROUP="opus",NAME="source",BANDWIDTH=8290304,CODECS="av01.0.13M.08.0.110.01.01.01.0,opus",RESOLUTION=3840x2160,FRAME-RATE=60,VIDEO="d3c355b1-02b5-4ce7-b866-27c520c5c92e",AUDIO="595eaf20-9b81-4e6a-8767-5e48d620d9e1"
d3c355b1-02b5-4ce7-b866-27c520c5c92e/index.m3u8
#EXT-X-STREAM-INF:GROUP="aac",NAME="source",BANDWIDTH=8323072,CODECS="av01.0.13M.08.0.110.01.01.01.0,mp4a.40.2",RESOLUTION=3840x2160,FRAME-RATE=60,VIDEO="d3c355b1-02b5-4ce7-b866-27c520c5c92e",AUDIO="adf09098-38ec-4447-a2b6-ff3735df4ac0"
d3c355b1-02b5-4ce7-b866-27c520c5c92e/index.m3u8
#EXT-X-STREAM-INF:GROUP="opus",NAME="720p",BANDWIDTH=4194304,CODECS="avc1.640033,opus",RESOLUTION=1280x720,FRAME-RATE=60,VIDEO="0f3bd47a-5a29-4dc6-af88-62ad3f1df7c0",AUDIO="595eaf20-9b81-4e6a-8767-5e48d620d9e1"
0f3bd47a-5a29-4dc6-af88-62ad3f1df7c0/index.m3u8
#EXT-X-STREAM-INF:GROUP="aac",NAME="720p",BANDWIDTH=4227072,CODECS="avc1.640033,mp4a.40.2",RESOLUTION=1280x720,FRAME-RATE=60,VIDEO="0f3bd47a-5a29-4dc6-af88-62ad3f1df7c0",AUDIO="adf09098-38ec-4447-a2b6-ff3735df4ac0"
0f3bd47a-5a29-4dc6-af88-62ad3f1df7c0/index.m3u8
#EXT-X-STREAM-INF:GROUP="opus",NAME="480p",BANDWIDTH=2146304,CODECS="avc1.640033,opus",RESOLUTION=853x480,FRAME-RATE=30,VIDEO="3a20175f-5bfb-400c-9aa2-358df5501052",AUDIO="595eaf20-9b81-4e6a-8767-5e48d620d9e1"
3a20175f-5bfb-400c-9aa2-358df5501052/index.m3u8
#EXT-X-STREAM-INF:GROUP="aac",NAME="480p",BANDWIDTH=2179072,CODECS="avc1.640033,mp4a.40.2",RESOLUTION=853x480,FRAME-RATE=30,VIDEO="3a20175f-5bfb-400c-9aa2-358df5501052",AUDIO="adf09098-38ec-4447-a2b6-ff3735df4ac0"
3a20175f-5bfb-400c-9aa2-358df5501052/index.m3u8
#EXT-X-STREAM-INF:GROUP="opus",NAME="360p",BANDWIDTH=1122304,CODECS="avc1.640033,opus",RESOLUTION=640x360,FRAME-RATE=30,VIDEO="d08827ef-6aea-45c9-97b1-1608e3198b95",AUDIO="595eaf20-9b81-4e6a-8767-5e48d620d9e1"
d08827ef-6aea-45c9-97b1-1608e3198b95/index.m3u8
#EXT-X-STREAM-INF:GROUP="aac",NAME="360p",BANDWIDTH=1155072,CODECS="avc1.640033,mp4a.40.2",RESOLUTION=640x360,FRAME-RATE=30,VIDEO="d08827ef-6aea-45c9-97b1-1608e3198b95",AUDIO="adf09098-38ec-4447-a2b6-ff3735df4ac0"
d08827ef-6aea-45c9-97b1-1608e3198b95/index.m3u8

In this manifest we transcode both AAC audio and OPUS audio, Opus is smaller and better quality than AAC so it should be preferred if the client supports Opus.

Types of changes

What types of changes does your code introduce to Scuffle?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING doc
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in downstream modules

@TroyKomodo TroyKomodo requested review from a team as code owners May 29, 2023 00:23
@TroyKomodo TroyKomodo temporarily deployed to lint-test-build May 29, 2023 00:23 — with GitHub Actions Inactive
@TroyKomodo TroyKomodo mentioned this pull request May 29, 2023
4 tasks
Copy link
Contributor

@SputNikPlop SputNikPlop left a comment

Choose a reason for hiding this comment

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

LGTM

@TroyKomodo TroyKomodo requested review from a team, treuks, IS2511 and 4w3Official May 29, 2023 15:03
@TroyKomodo
Copy link
Member Author

Ill fix ci after approve from 1 more reviewer

Copy link
Member

@lennartkloock lennartkloock left a comment

Choose a reason for hiding this comment

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

I don't know enough about the video stuff but looks good in general

maskfile.md Show resolved Hide resolved
Completes #86 bullet point 4

This change refactors how we store the stream variants and also sets up
the transcoder for unit tests and cleans up the way transcoder invokes
ffmpeg.
@TroyKomodo TroyKomodo merged commit 4a7486e into main May 29, 2023
@TroyKomodo TroyKomodo deleted the troy/transcoder branch May 29, 2023 16:05
@TroyKomodo TroyKomodo temporarily deployed to lint-test-build May 29, 2023 16:05 — with GitHub Actions Inactive
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.

3 participants