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

metrics: populate undetected audio/video codecs as "n/a" #564

Merged
merged 1 commit into from
Apr 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions pipeline/coordinator.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,20 @@ func (c *Coordinator) startOneUploadJob(p UploadJobPayload, handler Handler, for
pipeline = "aws-mediaconvert"
}

videoTrack, _ := p.InputFileInfo.GetTrack(video.TrackTypeVideo)
audioTrack, _ := p.InputFileInfo.GetTrack(video.TrackTypeAudio)
// Codecs are parsed here primarily to write codec stats for each job
var videoCodec, audioCodec string
videoTrack, err := p.InputFileInfo.GetTrack(video.TrackTypeVideo)
if err != nil {
videoCodec = "n/a"
} else {
videoCodec = videoTrack.Codec
}
audioTrack, err := p.InputFileInfo.GetTrack(video.TrackTypeAudio)
if err != nil {
audioCodec = "n/a"
} else {
audioCodec = audioTrack.Codec
}

si := &JobInfo{
UploadJobPayload: p,
Expand All @@ -355,8 +367,8 @@ func (c *Coordinator) startOneUploadJob(p UploadJobPayload, handler Handler, for
transcodedSegments: 0,
targetSegmentSizeSecs: p.TargetSegmentSizeSecs,
catalystRegion: os.Getenv("MY_REGION"),
sourceCodecVideo: videoTrack.Codec,
sourceCodecAudio: audioTrack.Codec,
sourceCodecVideo: videoCodec,
sourceCodecAudio: audioCodec,
}
si.ReportProgress(clients.TranscodeStatusPreparing, 0)

Expand Down