Repository navigation
Conversation
手机(iPhone等)拍摄的 mov 视频,旋转信息只保存在 display matrix 元数据中, JavaCV 逐帧转码时帧本身未旋转,而 FFmpegFrameRecorder 未写入该元数据, 导致转码后的 mp4 方向错误。现从 grabber 读取 displayRotation 并设置到 recorder。 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
问题
手机(如 iPhone)拍摄的竖屏 mov 视频,旋转信息只存在 display matrix 元数据里。
Mediatomp4Service用 JavaCV 逐帧转码,帧本身未旋转,且FFmpegFrameRecorder没有写入该元数据,所以转码出来的 mp4 播放时被旋转了 90°。修改
在
configureRecorder中读取grabber.getDisplayRotation(),非 0 时调用recorder.setDisplayRotation(...)写入输出文件(二者角度约定一致,均为 ffmpegav_display_rotation_*)。仅新增 5 行。验证
已用 JDK 21 编译打包通过。竖屏 iPhone mov 的实际预览效果请合并前由维护者/评审再确认。
🤖 Generated with Claude Code