Repository navigation
test(recording): a Dolby Vision recording keeps its configuration record - #1096
Conversation
Records an HEVC stream whose parameters carry a Dolby Vision configuration record (Profile 8.1, 8.4 and 5) through LiveRecordingWriter, opens the written file again and reads the record back through dvConfig, the probe playback routes on. It pins the mpegts muxer's Dolby Vision descriptors (FFmpegBuild#11), which main has since 572a8f7 with FFmpegBuild 3.16.0. Against 3.15.0 all three cases fail, the file has no record; against 3.16.0 they pass.
There was a problem hiding this comment.
Automated review
Status: 🟡 Minor follow-ups. Only small touch-ups left.
This PR adds the engine-side test asked for in FFmpegBuild#11. It writes an HEVC stream that carries a Dolby Vision configuration record (Profile 8.1, 8.4 and 5) through LiveRecordingWriter, then reads the file back through AetherEngine.dvConfig(stream:), the same probe routing uses. That is the right thing to test. The writer copies coded_side_data with avcodec_parameters_copy, and the probe reads AV_PKT_DATA_DOVI_CONF from the demuxed codecpar, so the test covers the whole path. The PR body says all three cases fail on FFmpegBuild 3.15.0, so the test can fail without the fix.
Findings
- Nit: the HEVC NAL header comment says "layer 0, tid 1", but
annexBPayloadwrites only one header byte. The second byte is the 0x88 filler, which gives layer 17 and tid_plus1 0. The muxer reads only the first byte, so the test still works, but the comment is wrong. (Tests/AetherEngineTests/LiveRecordingWriterTests.swift:471) - Nit: the result of
av_packet_side_data_addis thrown away. If it ever fails, the record leaks and the test fails later on a confusingnilprofile. (Tests/AetherEngineTests/LiveRecordingWriterTests.swift:433)
Checklist: CHANGELOG yes (the entry is already on main under [Unreleased]), docs n.a., tests yes, traits both ways n.a.
Needs a device run: nothing beyond CI
Thanks for following up on FFmpegBuild#11 with a test that pins the fix.
Automated review by Quint (Claude) of 5ef09fa. It reads the code, it does not build or run it; a maintainer reviews and merges.
| onFailure: { _ in } | ||
| ) | ||
| for i in 0..<10 { | ||
| // HEVC NAL header: type 19 (IDR_W_RADL) then type 1 (TRAIL_R), layer 0, tid 1. |
There was a problem hiding this comment.
Nit: this comment does not match the bytes written. annexBPayload writes only one NAL header byte (0x26 or 0x02). The second HEVC header byte is then the 0x88 filler, which decodes as nuh_layer_id 17 and nuh_temporal_id_plus1 0, not "layer 0, tid 1". The TS muxer only looks at the first byte to decide whether to insert an AUD, so the test is unaffected. Either fix the comment to name only the NAL type, or append a real second byte (0x01) for these HEVC packets.
| dovi.pointee.rpu_present_flag = 1 | ||
| dovi.pointee.bl_present_flag = 1 | ||
| dovi.pointee.dv_bl_signal_compatibility_id = compatibility | ||
| _ = av_packet_side_data_add(&p.pointee.coded_side_data, &p.pointee.nb_coded_side_data, |
There was a problem hiding this comment.
Nit: the return value of av_packet_side_data_add is discarded. If the call fails, it does not take ownership of dovi, so the record leaks. The test then fails later with a nil profile that points at the muxer instead of the setup. A #require(av_packet_side_data_add(...) != nil) (or a precondition, since this helper does not throw) puts the failure in the right place.
…ix the NAL comment Follow-up to PR #1096 from Quint's review: the record attach no longer drops its result (a failure would have leaked the record and failed later on a nil profile), the codecpar goes through avcodec_parameters_free so its side data is released, and the NAL header comment describes the one byte annexBPayload writes. Refs superuser404notfound/FFmpegBuild#11 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SeT6NgMt1vv32kPBhUmsUz
0a01c6a
into
superuser404notfound:main
|
Merged, thanks @MistyKuu. Having all three profiles pinned, and checked against 3.15.0 so we know the test actually catches the old muxer, is exactly what FFmpegBuild#11 needed. I added one small follow-up on top (e64807f) for Quint's two nits: the result of |
Summary
The engine test for FFmpegBuild#11, as asked there: a live recording of a Dolby Vision stream keeps its configuration record. Test only; main already has the FFmpegBuild 3.16.0 pin (572a8f7) and the CHANGELOG entry.
What changed
LiveRecordingWriterTests: "a Dolby Vision recording keeps its configuration record", parameterized over Profile 8.1, 8.4 and 5. It writes an HEVC stream whose codecpar carries anAV_PKT_DATA_DOVI_CONFrecord throughLiveRecordingWriter, opens the file again and checks the profile and compatibility id thatAetherEngine.dvConfig(stream:)reads back.Test plan
swift test --filter LiveRecordingWriterTests11 tests passed, the new one with all 3 cases.exact: "3.15.0"locally, not committed): all 3 cases fail on the profile and on the compatibility id, the other 8 tests pass.swift teston 3.16.0: the new test and the rest of the suite pass, exceptSoftwarePacketReadAheadParkTests(AE#1053 spike case) andSubtitleOCRTests(Vision, 180 s limit), which also fail on their own on this machine while it was under heavy load from other jobs. Neither touches the recording writer, and CI on 572a8f7 is green.Scripts/check-test-hygiene.py,check-doc-links.py,check-source-map.pyclean.Refs superuser404notfound/FFmpegBuild#11
Checklist
CHANGELOG.mdupdated (the entry is already on main)feat(...),fix(...),chore(...))