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

Call Mist to transcode input manifest and push renditions to S3 #41

Merged
merged 14 commits into from Sep 29, 2022

Conversation

thomshutt
Copy link
Contributor

@thomshutt thomshutt commented Sep 9, 2022

curl --location --request POST 'http://localhost:4949/api/transcode/file' \ 
--header 'Authorization: Bearer IAmAuthorized' \ 
--header 'Content-Type: application/json' \ 
--data-raw '{
  "source_location": "s3+https://REDACTED:REDACTED@storage.googleapis.com/alexk-dms-upload-test/avsample.mp4",
  "callback_url": "https://webhook.site/YOUR-UNIQUE-URL-HERE",
  "manifestID": "somestream123",
  "profiles": [
        {
        "name": "360p",
          "width": 640,
          "height": 360,
          "bitrate": 200000,
          "fps": 24
        }
    ], 
  "verificationFreq": 1}'

This PR still needs some tidying, async transcode (i.e HTTP call shouldn't wait for that) added back in and lots of unit tests - ideally mostly at the function rather than HTTP level since we don't have a good story around mocking MistProcLivepeer yet.

@thomshutt thomshutt marked this pull request as draft September 9, 2022 15:07
config/config.go Outdated Show resolved Hide resolved
config/config.go Outdated Show resolved Hide resolved
handlers/misttriggers/live_tracklist.go Show resolved Hide resolved
handlers/misttriggers/live_tracklist.go Show resolved Hide resolved
handlers/misttriggers/live_tracklist.go Outdated Show resolved Hide resolved
handlers/misttriggers/live_tracklist.go Outdated Show resolved Hide resolved
handlers/transcode.go Outdated Show resolved Hide resolved
handlers/transcode.go Outdated Show resolved Hide resolved
handlers/transcode.go Outdated Show resolved Hide resolved
handlers/transcode.go Outdated Show resolved Hide resolved
handlers/handlers_test.go Show resolved Hide resolved
thomshutt and others added 3 commits September 27, 2022 21:17
cache:
- Add transcoding streams to system cache

misttriggers:
- add handlers for LIVE_TRACK_LIST and PUSH_END triggers

transcode:
- add handler to launch MistProcLivepeer to kickoff transcode flow
This will be updated later to test a specific portion of the pipeline
instead of an e2e test triggered by an html endpoint.
…add studio transcode support

* exec-ing MistProcLivepeer and then opening pipes was causing it to sometimes exit
  prematurely. I used a similar method but refactored to fix this issue.

* Added support for using one of two methods of transcode:
	1. livepeer.studio w/ developer access-token: this uses production BOT nodes
	   to perform the transcoding.
	2. local hardcoded broadcaster: this uses a local broadcaster running in bg
	   to perform the transcoding.
  These additional parameters were added to the json schema for the incoming transcode
  requests.
Copy link
Contributor

@AlexKordic AlexKordic left a comment

Choose a reason for hiding this comment

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

Well done. Some of my comments may be out of scope of this PR

handlers/misttriggers/live_tracklist.go Outdated Show resolved Hide resolved
handlers/transcode.go Show resolved Hide resolved
handlers/transcode.go Outdated Show resolved Hide resolved
handlers/transcode.go Outdated Show resolved Hide resolved
handlers/transcode.go Show resolved Hide resolved
handlers/transcode.go Outdated Show resolved Hide resolved
Copy link
Member

@yondonfu yondonfu left a comment

Choose a reason for hiding this comment

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

Needs a go mod tidy.

handlers/misttriggers/live_tracklist.go Outdated Show resolved Hide resolved
handlers/misttriggers/live_tracklist.go Show resolved Hide resolved
emranemran and others added 7 commits September 28, 2022 21:33
cache:
- Add transcoding streams to system cache

misttriggers:
- add handlers for LIVE_TRACK_LIST and PUSH_END triggers

transcode:
- add handler to launch MistProcLivepeer to kickoff transcode flow
This will be updated later to test a specific portion of the pipeline
instead of an e2e test triggered by an html endpoint.
…add studio transcode support

* exec-ing MistProcLivepeer and then opening pipes was causing it to sometimes exit
  prematurely. I used a similar method but refactored to fix this issue.

* Added support for using one of two methods of transcode:
	1. livepeer.studio w/ developer access-token: this uses production BOT nodes
	   to perform the transcoding.
	2. local hardcoded broadcaster: this uses a local broadcaster running in bg
	   to perform the transcoding.
  These additional parameters were added to the json schema for the incoming transcode
  requests.
@codecov
Copy link

codecov bot commented Sep 29, 2022

Codecov Report

Merging #41 (d3b09bf) into main (7689ffc) will decrease coverage by 12.56932%.
The diff coverage is 0.36900%.

Impacted file tree graph

@@                 Coverage Diff                  @@
##                main         livepeer/catalyst#41          +/-   ##
====================================================
- Coverage   44.64286%   32.07354%   -12.56932%     
====================================================
  Files             15          16           +1     
  Lines            728         979         +251     
====================================================
- Hits             325         314          -11     
- Misses           364         628         +264     
+ Partials          39          37           -2     
Impacted Files Coverage Δ
cache/transcoding.go 34.04255% <0.00000%> (-11.67174%) ⬇️
handlers/misttriggers/live_tracklist.go 0.00000% <0.00000%> (ø)
handlers/misttriggers/push_end.go 0.00000% <0.00000%> (ø)
handlers/misttriggers/triggers.go 10.41667% <0.00000%> (-0.10966%) ⬇️
handlers/transcode.go 7.85714% <0.00000%> (-36.58730%) ⬇️
handlers/upload.go 44.11765% <100.00000%> (-7.16441%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7689ffc...d3b09bf. Read the comment docs.

Impacted Files Coverage Δ
cache/transcoding.go 34.04255% <0.00000%> (-11.67174%) ⬇️
handlers/misttriggers/live_tracklist.go 0.00000% <0.00000%> (ø)
handlers/misttriggers/push_end.go 0.00000% <0.00000%> (ø)
handlers/misttriggers/triggers.go 10.41667% <0.00000%> (-0.10966%) ⬇️
handlers/transcode.go 7.85714% <0.00000%> (-36.58730%) ⬇️
handlers/upload.go 44.11765% <100.00000%> (-7.16441%) ⬇️

@emranemran emranemran dismissed yondonfu’s stale review September 29, 2022 06:44

Addressed all comments - github is confused after a force push?

@emranemran emranemran merged commit ff9b8ae into main Sep 29, 2022
@hjpotter92 hjpotter92 deleted the transcode branch September 29, 2022 06:45
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.

None yet

4 participants