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

Fix overwriting of 7-bit PictureID when doing VP8 simulcast #3121

Merged
merged 3 commits into from
Dec 21, 2022

Conversation

lminiero
Copy link
Member

@lminiero lminiero commented Dec 13, 2022

We noticed a problem in our simulcast management when using non-browser sources, specifically an FFmpeg source for RTP packets. When doing VP8 simulcast, the server needs to ensure monotonically increasing PictureID values, which is what we do in Janus. Older versions of FFmpeg (before this was patched), though, used 7-bit PictureID values in the VP8 payload header, and we found out our code didn't handle that well, since we were always assuming 15-bit values when overwriting it: this resulted in the payload getting one byte "eaten" away, and the VP8 payload to be corrupted as well.

This patch tries to address that, and to ensure we don't overflow either 7-bit or 15-bit PictureID values when an overwrite process is taking place. If you're using simulcast, please do test this out to ensure we're not introducing any regression, and that it still works as expected for you. Feedback on whether you notice something wrong in the code is welcome too, of course!

Edit: side note, as explained here, browsers don't really support 7-bit properly anyway (there's a bug open), so our fix for 7-bit PictureID improves things but doesn't fix them when 7-bit values are used (video still freezes occasionally). That said, I still think it's important we fix the behaviour in Janus, in case it's fixed in browsers too eventually.

@lminiero lminiero added the multistream Related to Janus 1.x label Dec 13, 2022
@lminiero
Copy link
Member Author

Merging.

@lminiero lminiero merged commit 40e80b1 into master Dec 21, 2022
@lminiero lminiero deleted the vp8-7bit-pid branch December 21, 2022 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
multistream Related to Janus 1.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant