Conversation
Recordings from the current devicekit-ios extension decoded as one frame with a duration of hundreds of hours. - the timecode SEI precedes the picture it stamps, but grouping attached it to the previous access unit, shifting every timestamp by one frame and emitting SPS/PPS as a sample without a slice - High profile streams contain B-frames, so timestamps arrive in decode order; writing pts == dts made the unsigned deltas wrap Timestamps are now held until the next slice claims them, parameter sets stay with their key frame, and dts walks the sorted timestamps with pts pushed back by the reorder delay so dts <= pts always holds.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Essentials Run ID: 📒 Files selected for processing (2)
Included review availability: 0 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour. 📝 WalkthroughWalkthroughChangesAVC timestamped MP4 conversion
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to No concrete merge-blocking playback, decoding, or conversion failure remains. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
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.
Summary
screenrecordon real iOS devices produced mp4 files that ffmpeg decodes as 1 frame with a duration of ~353 hours, while mobilecli itself reported sane numbers (299 frames, 4.916s).Two causes in
pkg/avc2mp4:MOBILENXTIMECODESEI before the picture it stamps.groupAccessUnitsassumed it trailed, so every access unit got the next frame's timestamp and SPS/PPS were flushed as a sample with no slice. The tests modelled the same wrong order, so they passed.…544384, …511052, …494386, …527718). Writingpts == dtsfrom those made the unsigned deltas wrap.Changes:
sampleTimesMs: dts walks the sorted timestamps (monotonic) and every pts is pushed back by the largest reorder delay sodts <= pts. With no reordering the delay is zero anddts == pts.Convertreports duration from min/max timestamp rather than first/last in decode order.The extension is also being fixed to stop emitting B-frames, but this keeps recordings from already-deployed extensions playable.
Test plan
go test ./pkg/avc2mp4/ -race; fixtures now use the real SEI-before-slice order; new tests for parameter sets staying with their key frame and for reordered timestamps (real values from a device)Summary by CodeRabbit