Repository navigation
[FIX] Compute FFmpeg tx3g end time in one step - #2387
Merged
Merged
Conversation
#2378 derives the end of a tx3g cue as start_ms + duration * 1000 / timescale. Both terms are truncated separately, so the end can land 1 ms before the GPAC path's, which converts pts + duration at once. On a real m4v with 797 cues, 99 ended 1 ms early (e.g. timescale 600, pts 135725, duration 2725: 230749 instead of 230750).
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.
In raising this pull request, I confirm the following (please check boxes):
Reason for this PR:
Sanity check:
Repro instructions:
Build with
-DWITH_FFMPEG=ONand extract thetx3gtrack of sample 162 on the sample platform (Yomeddine_1080p_HD, m4v, 797 cues) with--out=srt; compare against the default (GPAC) build.Follow-up to #2378. It derives a cue's end as
start_ms + pkt.duration * 1000 / timescale; both terms are truncated separately, so the end can land 1 ms before the GPAC path, which convertspts + durationin one step. On sample 162, 99 of 797 cues ended 1 ms early (e.g. timescale 600, pts 135725, duration 2725 → 230749 instead of 230750). This computes(pts + pkt.duration) * 1000 / timescale.Verified: on the FFmpeg build,
--out=srtoutput is now byte-identical to the GPAC build on sample 162 and on five synthetictx3gfiles (video + subtitle, subtitle-only,texthandler, #2378's own sample, and one with a cue at 0 plus contiguous and overlapping cues).cargo fmt --checkandcargo clippy --features enable_mp4_ffmpeg -- -D warningsare clean.