Skip to content

Preserve media creation and modification time when building "camm" video#809

Open
caglarpir wants to merge 1 commit intomainfrom
preserve-camm-media-timestamps
Open

Preserve media creation and modification time when building "camm" video#809
caglarpir wants to merge 1 commit intomainfrom
preserve-camm-media-timestamps

Conversation

@caglarpir
Copy link
Contributor

Summary

When building a CAMM (Camera Motion Metadata) track and injecting it into an MP4 video, the creation_time and modification_time fields from the source video's mvhd (Movie Header Box) were not being carried over to the new CAMM track's tkhd (Track Header Box) and mdhd (Media Header Box). Both boxes were left with a default value of 0.

This change preserves those timestamps by:

  1. Reading creation_time and modification_time from the source mvhd inside camm_sample_generator2.
  2. Passing them through to create_camm_trak, which sets them on both tkhd and mdhd.

Test Plan

Added test_camm_trak_carries_mvhd_timestamps which:

  • Constructs a minimal MP4 with known creation_time / modification_time in the mvhd.
  • Builds a CAMM track via the full encode pipeline.
  • Parses the output MP4 and asserts that the CAMM track's tkhd and mdhd carry the original timestamps.

@meta-cla meta-cla bot added the cla signed label Feb 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant