Skip to content

Remux Synchronization

simonefil edited this page Aug 14, 2026 · 8 revisions

Remux Synchronization

Two releases of the same episode rarely line up. One starts with a distributor logo, one is a PAL transfer running 4% fast, one is the censored TV cut with 30 seconds missing in the middle. Synchronization is the part of Remux mode that deals with this.

It covers several independent mechanisms, each for a different problem. Selecting the wrong one wastes considerable time, so start from the table below.

Choosing a method

What you observe Use Cost
Imported audio is already in sync nothing: direct merge instant
Audio is off by a constant amount for the whole episode Frame-sync analysis pass over both videos
Audio drifts progressively, fine at the start, seconds off by the end Speed correction imported audio is re-encoded
Audio is fine in places and wrong in others; the releases have different edits, missing or added scenes Deep analysis slowest; usually forces audio re-encoding
You already know the exact offset Audio delay (manual) free

Rules that follow from the code:

  • Frame-sync and Deep analysis are mutually exclusive. Enabling one clears the other in the dialog.
  • Speed correction is independent and can be combined with either.
  • Manual delay is additive: it is applied on top of whatever the automatic method calculated, not instead of it.

Synchronization section

Direct merge

Leave Speed at Off, and both Frame-sync and Deep analysis unticked. Tracks are muxed at their existing timestamps.

Two releases derived from the same master normally agree, so this is often sufficient. Analyze first, read the SYNCHRONIZATION section of the detail panel, and enable an analysis method only if there is a measured problem.

Speed correction

Fixes a global speed difference: the whole episode plays at the wrong rate, so the error grows linearly through the file. The classic case is a PAL transfer (25 fps) against an NTSC/film one (23.976 fps), but it is not limited to that.

The default is Off. To enable correction, select the known Source and Language playback rates:

UI selection Internal factor
Source 23.976 - Lang 25 1001/960
Source 25 - Lang 23.976 960/1001
Source 23.976 - Lang 29.97 5/4
Source 29.97 - Lang 23.976 4/5
Source 25 - Lang 29.97 1200/1001
Source 29.97 - Lang 25 1001/1200

The UI deliberately has no free-text factor. The CLI accepts a decimal or fraction through --stretch-factor for automation and advanced cases. Speed correction verifies the selected ratio visually and resolves the constant offset; it never guesses a ratio from frame-rate metadata.

The correction is a temporal stretch materialised by FFmpeg: the imported Language audio tracks are rendered in the selected audio format, and the video is not re-encoded. The factor shows in the episode table's Stretch column, and the detail panel reports the resolved values as audio stretch materialized: factor F, ratio R, FFmpeg tempo T.

Speed correction therefore requires an audio format when Language audio is imported, on the same terms as Deep analysis. See Audio format requirement.

Frame-sync

Frame-sync finds one constant offset between the two videos through SIFT. It compares an initial NxM window, resolves one monotone path on the real PTS of both files, verifies the result with sparse local SIFT checkpoints along the episode, then refines the final value in a short full-rate window for frame accuracy. The resulting delay is applied to the imported tracks.

Use it when the edit is identical and only the starting point differs, different logo length, different amount of black at the head, a few seconds of trim.

The result is a single number, applied as a constant delay to the imported tracks. Where the required delay changes part-way through the episode, Frame-sync either reports low confidence or locks onto one section and is wrong about the rest. That case needs Deep analysis.

After analysis, the detail panel reports:

SYNCHRONIZATION
  Frame-sync:          applied
  Frame-sync offset:   -1042
  Confidence:          0.94
  Checkpoints:         6/7 valid
Line Read it as
Frame-sync offset the delay in ms that will be applied
Confidence how much agreement the matcher found; low values mean treat the result as suspect
Checkpoints how many verification points along the episode agreed with the chosen offset
Reason appears when Frame-sync failed, explaining why

How the offset is derived, and what the confidence value is computed from, is in Internals.

Low confidence or an outright failure usually means: the two releases are cropped differently (see Analysis crop), too few frames contain distinctive SIFT features, or the edits differ. See Troubleshooting.

Deep analysis

Deep analysis builds a timeline edit map containing cut and insert operations that describe how the language release differs from the source, region by region. It handles:

  • scenes removed from one release
  • scenes added to one release
  • different openings, endings or eyecatches
  • recap or next-episode-preview differences
  • any edit that makes the required delay change mid-file

Enable Deep analysis (full analysis) in the Synchronization section and analyze. It builds global SIFT evidence, resolves only suspicious regions at full rate, then refines the resulting frame-level boundaries; Internals describes the process. The episode table's Deep column shows how many operations were found, and the detail panel lists them:

SYNCHRONIZATION
  Deep analysis:       applied
  Edit operations:     3
    Cut    src 00:01:30.000 duration 22.5s
    Insert src 00:12:04.100 duration 8.0s

It is substantially slower than the other methods because it decodes and compares a large number of frames. Advanced settings independently offer GPU decode through ffmpeg and GPU SIFT through Vulkan; see Settings Reference and Docker.

Audio format requirement

Speed correction and Deep analysis both rewrite the imported audio timeline, so whenever Language audio is imported they require:

Setting Requirement
Audio format one of FLAC, LPCM, AAC, Opus, AC-3
Audio scope Lang or All; Disabled is refused

Validation reports this before anything runs:

  • Speed Correction requires an audio format when Language audio tracks are imported
  • DeepAnalysis requires an audio format when Language audio tracks are imported
  • With Speed Correction or DeepAnalysis the minimum audio scope is Language

Deep analysis applies the requirement to the complete batch: every Language track is processed, including episodes whose analysis produces a constant delay with zero cut or insert operations.

The detail panel labels these renders mandatory Speed/Deep conversion, to distinguish them from a conversion requested through the scope alone.

FLAC keeps the result lossless. Lang restricts the work to the imported tracks. See Remux Audio and Video.

How boundaries are found

Deep analysis is visual. SIFT correspondences first build global evidence, including explicit gaps and ambiguous support, then resolve each suspicious region into one canonical monotone path with zero, one or more observable offset regimes. Feature dropouts remain uncertain intervals. When a transition lies on black frames, paired black runs provide the preferred boundary after SIFT confirms the regimes. Ordered operations that reproduce the canonical path's offset changes form the validated EditMap.

Audio is rebuilt from the visual edit map. Boundary discovery and refinement use visual temporal evidence. Enabling Deep analysis for a batch that imports Language audio activates the audio format requirement for every imported Language track.

Diagnostics

For investigating a bad result, the CLI can dump the full analysis:

--framesync-diagnostics
--deep-analysis-diagnostics

JSON lands in .remux-forge/framesync-diagnostics/ and .remux-forge/deepanalysis-diagnostics/. Diagnostic export is a CLI facility.

Manual delay

Two places, both additive to whatever automatic sync produced.

For the whole batch: the Synchronization section has Audio delay and Sub delay in milliseconds. Use these when you know every episode needs the same nudge.

For one episode: right-click the row, choose Delay. The dialog shows the automatic offset it is adding to and the resulting effective values:

Auto sync offset: -1042 ms
Audio delay (ms): [ 40 ]
Sub delay (ms):   [ 0  ]
Effective delay audio: -1002ms, sub: -1042ms

This is how you fix the one episode in a season where Frame-sync landed a few frames off, without re-running the batch or compromising the episodes that were right.

Positive values delay the track; negative values pull it earlier.

Analysis crop

Frame-sync and Deep analysis compare pictures. If one release is letterboxed and the other is not, or one carries broadcast edge artefacts, the comparison degrades or fails even though the content is identical.

Crop src and Crop lang take pixels to remove, in the format L:R:T:B, measured on the original frame before any scaling:

Crop src:  0:0:130:130      # remove 130px of black bar top and bottom
Crop lang: 8:8:0:0          # remove 8px of edge noise left and right

Empty or 0:0:0:0 disables it.

This only affects the frames used for matching. It never crops the output video. RemuxForge is not re-framing your file; it is telling the matcher which part of the picture to trust.

Reach for this when Frame-sync fails or reports low confidence on releases you can see are framed differently.

Subtitle canvas rewrite

Subtitles carry their own coordinate space. Import a subtitle track authored for a 4K release into a 1080p file and the text ends up in the wrong place, or off screen. The same applies when the two releases have different crop or a different active picture area, such as 16:9 pillarboxed video going into a 4:3 source.

Rewrite subtitle canvas rewrites the geometry of imported subtitles. It is off by default and has to be enabled explicitly.

It is tied to visual analysis: it consumes the geometry that Frame-sync or Deep analysis already produced and does not run its own ffmpeg geometry probe. With neither enabled there is no geometry available, so the option is ignored and a warning is logged.

It never crops, scales or re-encodes the final video. It rewrites imported subtitle tracks only, and only where the transform can be expressed in the subtitle format.

Format Handled
PGS / SUP canvas, object coordinates and crop, windows, and the bitmaps themselves when the active areas differ in size
ASS / SSA script resolution, style margins and scales, and position, origin, movement, clip and drawing tags
VobSub (IDX/SUB) IDX geometry and file positions, SPU display area and, when scaling is required, the bitmap data

Cases the transform cannot express are skipped: the untransformed track is used and a warning is logged. The most common is ASS with rotation or shear tags under non-uniform scaling.

The rewrite never fails the remux. An unsupported or unsafe case falls back to the original track, so a successful rewrite and a warned fallback produce the same output file list. The log is the only place the difference appears.

Order of operations: Frame-sync or Deep analysis produces the geometry, Deep analysis may rewrite subtitle timelines first, canvas rewrite runs after that, and the result is validated before it replaces the imported track.

The field-by-field detail, and what each format's rewriter does at bitstream level, is in Internals.

Audio source fill

A different problem from sync: the imported audio track is shorter than it needs to be. It starts late, ends early, or Deep analysis wants to insert silence into a gap. Padding with silence is the default behaviour and it sounds like a hole.

Audio source fill takes the missing region from an audio track already present in the Source file and concatenates it onto the imported track instead. The result: the imported dub for the body of the episode, and the source language for the parts the dub does not cover, rather than silence.

The toggle appears in the Audio post-processing section, but only after you choose an Audio format: filling means rebuilding the track, which means encoding.

Once enabled, four things become required:

Field Meaning
Threshold Milliseconds. Fill only kicks in when the gap exceeds this. It is not a delay.
Source language Which source audio track to take the fill segments from.
Mode At least one of Start / End / Insert silence.
Audio scope Must be Lang or All, not Disabled.

The three modes

Mode Condition
Start The positive initial audio delay exceeds the threshold. The first N ms are taken from the Source and prepended to the imported track. Note that imported subtitles are not concatenated: they keep their calculated delay.
End source audio duration − (language track duration + applied delay) > threshold. If the Source has no reference audio track, the video track duration is used instead.
Insert silence Only offered with Deep analysis enabled. When Deep analysis produces an INSERT_SILENCE operation larger than the threshold, the corresponding segment is taken from the Source rather than being filled with silence.

For insert-silence, source fill uses the frame-level boundary finalized by Deep analysis, including a paired black-run boundary when one was accepted.

Choose the threshold to match what you care about: a 40 ms gap is inaudible and not worth splicing; a 3-second one is. Something in the 100–500 ms range is a reasonable default.

The detail panel's AUDIO PROCESSING section reports what actually happened per track, including source-fill configured, no fill above threshold when the condition never triggered.

Tuning the analysis

Settings ▸ Advanced settings (Remux mode only) exposes a handful of the analysis parameters:

Section Fields
Analysis Hardware Acceleration, SIFT backend

Hardware Acceleration controls ffmpeg GPU decoding. It is off by default and requires a selected ffmpeg method; if one hardware frame extraction fails, RemuxForge retries that extraction in software. SIFT backend selects CPU/OpenCV or Vulkan/GPU matching jointly for Frame-sync, Deep analysis and Speed correction. Neither setting enables hardware encoding.

Frame dimensions, checkpoint counts, confidence thresholds, scan durations and timeouts remain available in appsettings.json, but are deliberately not user controls: they are calibrated parts of the matching algorithms. Reset Defaults restores only the fields offered by the dialog.

The internal values are described in Settings Reference.

Next

Clone this wiki locally