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

Should not save (when recording) segments with zero video frames #1912

Merged
merged 2 commits into from
Jun 16, 2021

Conversation

darkdarkdragon
Copy link
Contributor

What does this pull request do? Explain your changes. (required)
Do not save segments with zero video frame to record store.

Specific updates (required)
Check segment before saving using lpmg.HasZeroVideoFrameBytes function.

How did you test each of these updates (required)
Unit test

Does this pull request close any open issues?
Fixes #1888

Checklist:

glog.Warningf("Error checking for zero video frame nonce=%d manifestID=%s name=%s bytes=%d took=%s err=%v",
nonce, mid, name, len(seg.Data), time.Since(now), err)
} else {
glog.Infof("Checking for zero video frame nonce=%d manifestID=%s name=%s bytes=%d took=%s returned res=%v",
Copy link
Contributor

Choose a reason for hiding this comment

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

This'll log every segment, yeah? Seems like it could be a glog.Debugf at least.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. Moved it around so it will show only for 0-frame segments.

@darkdarkdragon darkdarkdragon force-pushed the it/zero-video-no-save branch from b6841a0 to 65c7146 Compare June 10, 2021 20:41
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.

LGTM

@@ -386,6 +386,19 @@ func processSegment(cxn *rtmpConnection, seg *stream.HLSSegment) ([]string, erro
if ros != nil {
go func() {
now := time.Now()
hasZeroVideoFrame, err := ffmpeg.HasZeroVideoFrameBytes(seg.Data)
Copy link
Member

Choose a reason for hiding this comment

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

I see that this function was added in livepeer/lpms#237 and it returns an integer. Fine for now since that PR was already merged, but I think returning a boolean would make this function more straightforward to use and suggest making that change separately.

@darkdarkdragon darkdarkdragon merged commit 6ae59d7 into master Jun 16, 2021
@darkdarkdragon darkdarkdragon deleted the it/zero-video-no-save branch June 16, 2021 23:00
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.

Should not save (when recording) segments with zero video frames
3 participants