Skip to content

Instantly share code, notes, and snippets.

@hainesr
Last active May 20, 2025 20:06
Show Gist options
  • Save hainesr/0407c9fa15b8ba633a4c37683d98f08c to your computer and use it in GitHub Desktop.
Save hainesr/0407c9fa15b8ba633a4c37683d98f08c to your computer and use it in GitHub Desktop.
Convert a transmission stream from .rec (Topfield) to .mp4

From .rec (Topfield) to .mp4

Robert Haines

Rough notes for now

Use ProjectX [1] to cut to correct length, cut out adverts, and demux.

Use https://subtitletools.com/ to convert the SUP subtitles to SRT.

Use ffmpeg to remux the video, audio and subtitle streams.

export TITLE="my title"
ffmpeg -i "$TITLE.m2v" \
       -i "$TITLE.mp2" \
       -f srt -i "$TITLE-eng.srt" \
       -map 0:v:0 -map 1:a:0 -map 2:s:0 \
       -c:v copy -c:a copy -c:s mov_text \
       -metadata title="$TITLE" \
       -metadata:s:a:0 language=eng -metadata:s:s:0 language=eng \
       "$TITLE.mp4"

[1] https://sourceforge.net/p/project-x/discussion/393048/thread/2c26fa04/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment