Repository navigation
fix(host): 分条缩放的裁剪框越界导致软件编码每帧失败 - #144
Open
qwerty-a11y wants to merge 2 commits into
Open
qwerty-a11y wants to merge 2 commits into
qwerty-a11y wants to merge 2 commits into
Conversation
控制端连上后画面全黑、帧率一直是 0,被控端日志里反复出现:
encoding failed, recreating the encoder: scaling failed:
Source cropping option is invalid:
Size of the crop box is out of the image boundaries
原因:分条缩放按 y0 * scale 算每条的裁剪框,最后一条的底部坐标在浮点下可能比源高度
大一点点(1080 * (1372/1080) = 1372.0000000000002)。fast_image_resize 对越界的裁剪框
直接报错,于是每一帧都编码失败、编码器被反复重建,一帧也发不出去。虚拟机里的
2037×1372 这种奇数尺寸最容易碰上;普通显示器 1920×1080 缩放到 1080 高度时恰好整除,
所以平时看不出来。
修法:把裁剪框底部钳制到源图高度以内。只在真的越界时收紧那一条的高度,其余各条不变,
分条与整幅缩放仍然逐像素相同(striped_resize_matches_whole 不变)。
加了 striped_resize_odd_source_stays_inside 覆盖奇数源尺寸 × 不整除的缩放比 × 不同分条数。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
该问题会导致在特定非标准分辨率下,被控端无法编码视频画面,出现黑屏