Repository navigation
Preserve source clocks and VFR range-end coverage - #13
SteveYu000 wants to merge 1 commit into
Conversation
Refine only progressive non-TS clocks that need it, preserving ordinary CFR grids and timescales. Distinguish an internal segment seam from the end of a kept range so a normal 23.976 picture at 37.996 s is not reduced to a 4 ms flash by OUT at 38 s. Retain existing unbounded-hold semantics. Classify repeated holds against typical display gaps as well as the average, and let auto indexing scan ambiguous progressive B-frame sources whose public container table only supplies decode timestamps. Invalidate old classifications with seek-cache version 19. Keep the latest displayed picture writable at the final refined-clock tail: decoder reorder depth alone does not bound how many B pictures can follow that picture. Reuse the existing seam-buffer limit. Add an 80-case real-media suite and document its scope. Locally compile both v0.8.39 and this CLI with Rust 1.98/MSVC/FFmpeg 7.1.1: 45/80 to 80/80; review reproducer 41.708333 ms in MP4 and 42 ms in MKV; existing VFR 8/8; 574 workspace unit tests passed, four known Windows failures filtered; clippy exits zero with existing warnings. Historical matrix 140/235 to 165/235 without new failures. Twenty ordinary CFR MP4 files and all 70 TS/M2TS files remain byte-identical to the baseline. This is the independent source-clock/VFR split of DeepRegular#10. SAR DeepRegular#11, AV1/MP4 DeepRegular#12 and M2TS arrival-time changes are separate. A forced --index scan on the reviewer's duplicate-PTS synthetic input retains its pre-existing unbounded-hold behavior and is documented as a limitation.
|
Thank you for splitting this out and for fixing the 4 ms case. I built Confirmed
One request: please leave constant-rate sources on their nominal grid
Two smaller points
I'll write the Japanese counterpart of |
Preserve source clocks and VFR range-end coverage
This is the source-clock/VFR part split from #10, independently based on
v0.8.39. Related independent changes: SAR #11 and AV1/MP4 #12.
The original combined patch made a kept picture at 37.996 s last only 4 ms
before OUT at 38 s. This change retains the existing coded-length floor at
the end of a normal range, while using measured coverage at seams inside
the range. On the reviewer's exact default-mode command, the first range's
last picture now lasts 41.708333 ms in MP4 and 42 ms in MKV. All displayed
timestamps are checked, not just successful decoding.
Changes
period is not an integer number of source ticks. Leave ordinary CFR grids
and their original timescales unchanged, including avoiding unnecessary
fraction reduction. Keep the existing integer/time-step bounds.
the average. For unclassified progressive B-frame sources averaging over
1% below their declared rate, decline the decode-time-only container index
so default
autoscans presentation timestamps. This adds a sequentialread for those sources; ordinary CFR still uses the table.
Preserve existing
coded_length_unboundedbehavior for genuine holds.Account for the CFR planner's coarse-clock selection margin using measured
next-picture coverage, including copy coverage from the terminating point.
clock. The new tests found another short tail: three B pictures followed
a copied H.264 P picture although
has_b_frameswas two, so the P picturehad already been written when its final hold was known. The output ended
about 27 ms early. This path uses the existing 256 MiB buffer limit and
reports an error if it is exceeded.
reused. Add an 80-case real-media suite and a technical description.
There are no SAR, AV1 configuration-policy, M2TS arrival-clock, dependency or
audio/subtitle strategy changes. Japanese documentation is left to you as
offered in the review.
Validation actually run
Windows x64 / MSVC / Rust 1.98 / FFmpeg 7.1.1 shared SDK. Both the unmodified
v0.8.39 baseline and this CLI were compiled locally.
input SHA-256 values and the same final test script. It covers AVC, HEVC,
AV1, MP4/MKV, repeated holds, CFR, single/multiple ranges, aligned copies,
one-picture cuts, whole inputs, and ranges ending/lying inside long holds.
--keeparguments were run. The old Preserve source clocks, AV1 descriptions and M2TS arrival timestamps #10 executable reproduces 4 ms in both
containers; this change gives 41.708333 / 42 ms, with 794 pictures.
Single-range versions were checked too.
DTS ordering, movie/video-track duration, copied VCL bytes and pixels.
Repeated parameter-set NAL units are recorded separately from VCL changes.
baseline. Another 10 CFR MKV controls retain packet timing, payload and
configuration (their generated SegmentUIDs are not compared as file identity).
no newly failing cases. All 35 TS and 35 M2TS files are byte-identical
to v0.8.39. The remaining failures include the other split changes and the
existing TS/M2TS final-display-duration limitation.
the four are the already reproduced Windows-specific baseline failures
listed below. Clippy exits 0 with existing warnings only.
produces the same output file as the rebuilding run.
Filtered existing Windows tests:
input::tests::a_file_url_is_the_file_it_names,udfw::tests::an_image_being_written_by_another_run_is_left_to_it,udfw::tests::an_image_inside_its_own_folder_is_refused, andvobsub::tests::names_follow_the_whole_cut_name.Limits and test details
The review regression is tested with its original default
autoindexing.The synthetic input also contains duplicate timestamps and very short gaps.
With a separately forced
--index scan, both v0.8.39 and this branch retainthe existing unbounded-hold behavior: 796 pictures rather than the default
794, and an approximately 4 ms range boundary. This pre-existing variant is
not claimed fixed here. The change avoids reinterpreting that hold policy
as part of the source-clock fix.
The FFmpeg 7.1 synthetic B-frame VFR generator can write an edit list ending
at the final generated PTS. Only the reference pixel decoder uses
ignore_editlist=1to read all generated packets; outputs must decode normallyand meet their independent count/end checks. Matroska stores no DTS; equal
inferred DTS on the millisecond clock are recorded, while backwards ones
fail. MP4 DTS must strictly increase.
The suite checks timing/copying, not AV1 container-configuration compliance.
No Linux CI, GUI or hardware-player result is claimed. Extreme clocks that
cannot fit the existing 32-bit bounds retain the old bounded grid.
The new suite writes complete commands, input/binary/script hashes and results
to a fresh directory. Pass
--fixtures <previous-run>/fixturesto compareanother executable against exactly the same input bytes.