FRAMEFIELDOpen the video merger

Why Do Merged MP4 Frame Timestamps Alternate Between 41 and 42 ms?

A timestamp grid can make a steady frame rate look uneven. In our controlled 24 fps join, a 1000-tick MP4 track alternated between 41 and 42 ticks. A 12288-tick track used exactly 512 ticks per frame. Both retained the same 96 encoded packets.

Explore Clipy’s online video tools (affiliate link)

Measured timestamp grids

We generated two H.264 clips, red then blue, each 160 by 90 pixels, two seconds long and 24 frames per second. B frames were disabled so packet presentation order matched decode order. We joined the identical inputs twice with the FFmpeg concat demuxer and stream copy, changing only the output video track timescale.

At a timescale of 1000, the first packet presentation timestamps were 0, 42, 83, 125, 167, 208, 250 and 292. Consecutive increments were 41 or 42 ticks. At 12288, they were 0, 512, 1024, 1536, 2048, 2560, 3072 and 3584, with only 512-tick increments. Both outputs contained 96 video packets, and every corresponding packet checksum matched.

  1. 1000 ticks per second: 0 → 42 → 83 → 125
  2. 12288 ticks per second: 0 → 512 → 1024 → 1536
  3. Both joins: 96 packets; matching payload checksums
Measured presentation timestamps on two different integer grids. Compare times in seconds, not raw tick counts.

The calculation explains this particular result: 1000 divided by 24 is 41.6667, which cannot be represented as one integer tick interval. By contrast, 12288 divided by 24 is exactly 512. This control demonstrates timestamp rounding without a changed packet payload. It does not prove that every uneven timestamp in a phone recording is harmless, or test audio synchronization.

Reproduce the check

Install Node.js and FFmpeg, then run node reproduce.cjs. Set the FFMPEG environment variable if the executable is outside PATH. The script generates both inputs, joins each pair with -c copy -video_track_timescale 1000 and -c copy -video_track_timescale 12288, and extracts packet timestamps with -copyts -c copy -f framecrc.

Read the complete measured output and download the reproduction script. Keep the originals and inspect actual playback when diagnosing your own export. When ready, merge videos online.