Skip to content

Instantly share code, notes, and snippets.

@stephenchew
Created April 2, 2026 15:16
Show Gist options
  • Select an option

  • Save stephenchew/3240c819094e69aedb6bce810135a59e to your computer and use it in GitHub Desktop.

Select an option

Save stephenchew/3240c819094e69aedb6bce810135a59e to your computer and use it in GitHub Desktop.
Convert TS to MP4

Fast conversion

ffmpeg -i input.ts -c copy output.mp4

Quick one to one convert

filename="abc"
ffmpeg -i "$filename.ts" -c copy "$filename.mp4"

High compatibility conversion (Transcoding)

Not tested

ffmpeg -i input.ts -c:v libx264 -crf 23 -c:a aac -b:a 192k output.mp4

-c:v libx264: Encodes video using the H.264 codec.

-crf 23: Sets quality (18–28 is standard; lower is higher quality).

-c:a aac: Encodes audio to AAC format.

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