Skip to content

Why does an MP4 report three different durations, and which one should I use before upload?

Build a duration evidence sheet from the container, each selected track, and the first and last displayed pictures. Those values answer different questions. Do not replace a reported duration with whichever number passes an upload check. For AISwapLab existing-video replacement, the final prepared MP4 must contain the intended complete 4–10 second passage and remain within the current upload limit; a plausible header alone does not establish that.

MEDIA DIAGNOSTICS: FILES, STREAMS AND CLOCKSAISwapLab team · Editorial methodPublished 3 min read
See the recorded exampleExplore 67 Image SkillsIndependent finishing · Check the actual file
Editorial worksheet excerpt: Container duration; Selected video interval; Required editorial interval. See the complete table and sources below.
Editorial worksheet excerpt: Container duration; Selected video interval; Required editorial interval. See the complete table and sources below.

Duration evidence sheet

A media inspector can report a container duration, a video-track duration and an audio-track duration without any of them being a universal editing boundary. A late audio start, an encoded sound tail, a nonzero timeline origin or rounding between time bases can explain a disagreement. Conversely, a readable header can survive an incomplete transfer. This task produces an evidence sheet that another editor can reproduce from the same file, rather than diagnosing a source from a gallery screenshot. Keep the original bytes and filename stable while investigating.

Build the evidence

  1. 01

    Inventory the file without changing it

    Run the first command and save its JSON alongside the source. Record format duration and start_time separately from the selected video and audio fields. Preserve values as reported, including missing values; do not silently turn an absent duration into zero. The stream index identifies which track each measurement describes. Also note whether several moving video streams require an explicit source-view choice.

  2. 02

    Measure the displayed interval

    Run the frame query on the selected moving video stream. Work with the returned presentation timestamps, not packet decode order. Inspect the first and final actual pictures in an editor. The last frame timestamp marks when that picture starts, so it is not automatically the end of the picture's display interval. Record an explicit frame duration where available and mark any inferred final duration.

  3. 03

    Resolve the disagreement at the content boundary

    Compare the required final action and final audible content. If the audio extends beyond the picture, decide whether that tail belongs in the deliverable. If the local editor and upload browser disagree, test a separate compatible export and repeat the sheet. Do not overwrite the only original or truncate a final word simply to make displayed numbers equal.

A bounded example

Illustrative case: a container reports 6.04 seconds while the selected video reports 6.00 seconds and the final audible decay continues slightly longer. That is a different situation from a six-second header whose picture consistently fails after four seconds. The evidence sheet separates the first case's endpoint policy from the second case's incomplete-content investigation. These are diagnostic scenarios, not observed AISwapLab failure rates or generated-output benchmarks. The handoff should state which endpoint the next operator is expected to preserve, so a harmless sound tail is not mistaken for a missing action.

Local diagnostic commands

Documentation example: ffprobe was not installed in this local test environment, so these two probe commands were not executed. They are read-only local inspection commands; no generation request or credits are involved.

shell
ffprobe -v error -show_entries format=filename,start_time,duration:stream=index,codec_type,start_time,duration,time_base -of json source.mp4 > duration.json
ffprobe -v error -select_streams V:0 -show_frames -show_entries frame=best_effort_timestamp_time,duration_time -of json source.mp4 > displayed-frames.json

Duration evidence sheet

MeasurementMeaningEvidence
Container durationWrapper-level summaryduration.json
Selected video intervalDisplayed picture timingdisplayed-frames.json and endpoint inspection
Required editorial intervalContent the brief needsApproved first and last actions

Acceptance evidence

  • Record the exact file identity and selected track index with every duration.
  • Check first and last visible actions rather than accepting a header-only pass.
  • Label measured, missing and inferred endpoint values distinctly.
  • Reopen the final prepared copy before assigning replacement people.

Stop condition

Stop if the required ending cannot be decoded from any authorized complete copy. A duration calculation cannot reconstruct missing performance. Obtain another source or involve an editor when the timing origin remains ambiguous; repeated remuxing without an evidence sheet only creates more versions to confuse.

Sources

Review the result in context.

Compare the recorded example and its documented limitations.

See the recorded example