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

upload: added forceMp4 flag #161

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

gioelecerati
Copy link
Member

@gioelecerati gioelecerati commented Mar 1, 2023

@codecov
Copy link

codecov bot commented Mar 1, 2023

Codecov Report

Merging #161 (8d588c9) into main (c4d56d3) will decrease coverage by 0.02511%.
The diff coverage is 0.00000%.

❗ Current head 8d588c9 differs from pull request most recent head e6a4654. Consider uploading reports for the commit e6a4654 to get more accurate results

Impacted file tree graph

@@                 Coverage Diff                 @@
##                main        #161         +/-   ##
===================================================
- Coverage   10.87460%   10.84949%   -0.02511%     
===================================================
  Files             14          14                 
  Lines           2161        2166          +5     
===================================================
  Hits             235         235                 
- Misses          1909        1914          +5     
  Partials          17          17                 
Impacted Files Coverage Δ
clients/catalyst.go 88.31169% <ø> (ø)
task/upload.go 6.65236% <0.00000%> (-0.07215%) ⬇️

Continue to review full report in Codecov by Sentry.

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

Impacted Files Coverage Δ
clients/catalyst.go 88.31169% <ø> (ø)
task/upload.go 6.65236% <0.00000%> (-0.07215%) ⬇️

Copy link
Member

@victorges victorges left a comment

Choose a reason for hiding this comment

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

LGTM but added another view on the generateMp4s field

task/upload.go Outdated
Comment on lines 514 to 517
generateMp4s := false
if tctx.OutputAsset.GenerateMp4s {
generateMp4s = true
}
Copy link
Member

Choose a reason for hiding this comment

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

any reason for the indirection?

Suggested change
generateMp4s := false
if tctx.OutputAsset.GenerateMp4s {
generateMp4s = true
}
generateMp4s := tctx.OutputAsset.GenerateMp4s

task/upload.go Outdated
@@ -156,7 +156,7 @@ func TaskTranscodeFile(tctx *TaskContext) (*TaskHandlerOutput, error) {
tctx: tctx,
inUrl: params.Input.URL,
getOutputLocations: func() ([]clients.OutputLocation, error) {
_, outputLocation, err := outputLocations(params.Storage.URL, params.Outputs.HLS.Path, false)
_, outputLocation, err := outputLocations(params.Storage.URL, params.Outputs.HLS.Path, false, false)
Copy link
Member

Choose a reason for hiding this comment

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

Would probably make sense to already add this to the transcode API as well. WDYT? cc @leszko

Copy link
Contributor

@leszko leszko Mar 13, 2023

Choose a reason for hiding this comment

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

Good question. I think we want to be able to generate MP4 files with the Transcode API, but I'm not sure if we want to always do it or introduce a flag for it. @ericxtang what do you think? Should we always generate MP4 outputs?

Copy link
Contributor

@leszko leszko Mar 14, 2023

Choose a reason for hiding this comment

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

As mentioned here by @ericxtang we also want this feature in Transcode API.

@gioelecerati could you add it here and also in the Transcode API in Studio?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure! Still a staticMp4 flag in the params or would it be better to add a mp4 output in the outputs fields in the transcode request?

Copy link
Member

Choose a reason for hiding this comment

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

Related discussion: livepeer/catalyst-api#518 (comment)

IMO we should not have it automatically generated for transcode API unless users explicitly request for it (the automatic generation, that is). It might be cleaner to wait until we have the Catalyst enum for this and then create a corresponding one on the Studio transcode-file API.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, we'll have a parameter in Transcode API to generate MP4. Here's the related Linear: https://linear.app/livepeer/project/mp4-in-transcode-api-708bdd704de5

task/upload.go Outdated
@@ -551,6 +555,7 @@ func outputLocations(outURL string, relativePath string, autoMp4s bool) ([]Outpu
SourceSegments: sourceSegments,
TranscodedSegments: true,
AutoMP4: autoMp4s,
GenerateMP4: generateMp4s,
Copy link
Member

Choose a reason for hiding this comment

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

Continuing the comment I made on the API, I think here and on the task object the field makes sense! Only on the assets that I think it is a bit weird.

e.g. GET /asset/:id => { ..., generateMp4s: true } what does it mean on a response for example? Since we're using a verb it'd have to be in the past to make more sense, but my suggestion is to not use a verb at all (on assets), using a "state description" instead.

@gioelecerati gioelecerati changed the title upload: added generateMp4 flag upload: added forceMp4 flag Mar 10, 2023
@mjh1 mjh1 removed their request for review June 9, 2023 09:22
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

3 participants