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

Ensure signature comparison success ratio among Nvidia and CPU signatures #357

Merged
merged 3 commits into from
Dec 3, 2022

Conversation

cyberj0g
Copy link
Contributor

livepeer/go-livepeer#2654

Changes

  • Add signature files calculated during Nvidia and CPU transcoding
  • Add a unit test, which calculates and ensures that false negative (signature mismatch for matching renditions) ratio is less than 1% between Nvidia and CPU signatures
  • Add a unit test, which calculates and ensures that false positive (signature match for different renditions) ratio is less than 15% for both CPU and Nvidia signatures

For this unit test to pass, a PR which sets threshold to detect frames as similar in signature comparison function of Ffmpeg needs to be merged first.

Below are results for the threshold value of 116 (default) and 150 (new value). I think, such an increase in FP ratio is acceptable. New value was picked by hand in a few attempts, to reduce the chance of overfitting our limited test dataset.

th_xh (thl1) = 116
----------------
CPU 360p False Positive rate: 0.091133
CPU 720p False Positive rate: 0.110837
Nvidia 360p False Positive rate: 0.091133
Nvidia 720p False Positive rate: 0.110837
CPU - Nvidia 360p False Negative rate: 0.068966
CPU - Nvidia 720p False Negative rate: 0.000000

th_xh (thl1) = 150
----------------
CPU 360p False Positive rate: 0.103448
CPU 720p False Positive rate: 0.125616
Nvidia 360p False Positive rate: 0.113300
Nvidia 720p False Positive rate: 0.128079
CPU - Nvidia 360p False Negative rate: 0.000000
CPU - Nvidia 720p False Negative rate: 0.000000

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.

Curious if generating signatures instead of checking them in would be possible since that would allow us to do comparisons of signatures generated using the current ffmpeg impl being used? Would also reduce repo clutter. Thoughts?

ffmpeg/sign_test.go Outdated Show resolved Hide resolved
ffmpeg/sign_test.go Outdated Show resolved Hide resolved
@cyberj0g
Copy link
Contributor Author

cyberj0g commented Dec 1, 2022

Thanks @yondonfu, all comments are addressed. We can generate signatures right in the test, since lpms tests are running on GPU runner now.

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!

cp "$1/../data/bunny2.mp4" .
ffmpeg -loglevel warning -i bunny2.mp4 -c copy -f hls -hls_time 2 hls/source.m3u8
`
assert.True(run(cmd))
Copy link
Member

Choose a reason for hiding this comment

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

This setup is much cleaner!

@cyberj0g cyberj0g merged commit e4a46d5 into master Dec 3, 2022
@hjpotter92 hjpotter92 deleted the ip/sign-accuracy branch June 1, 2023 07:06
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

2 participants