Skip to content

Instantly share code, notes, and snippets.

View AsherJingkongChen's full-sized avatar
🥺
www

Asher Chen (YLC) AsherJingkongChen

🥺
www
View GitHub Profile
@AsherJingkongChen
AsherJingkongChen / embed_sub.md
Created October 16, 2024 15:24 — forked from gmolveau/embed_sub.md
Embed subtitle (soft) in mp4/mkv file with ffmpeg without re-encoding

solution from https://stackoverflow.com/a/17584272/2627873

This solution adds the subtitles to the video as a separate optional (and user-controlled) subtitle track.

So you can choose the subtitle in VLC for example, it's not hard-coded or burned-in. And it won't re-encode the entire file so it's really fast.

  • ffmpeg is required
  • movie = great_movie.mp4 (works with mkv too)
  • subtitle = great_movie.english.srt