Skip to content

Instantly share code, notes, and snippets.

@mayeaux
Forked from gmolveau/embed_sub.md
Created November 18, 2022 00:46

Revisions

  1. @gmolveau gmolveau revised this gist Apr 18, 2020. 1 changed file with 8 additions and 0 deletions.
    8 changes: 8 additions & 0 deletions embed_sub.md
    Original file line number Diff line number Diff line change
    @@ -11,4 +11,12 @@ And it won't re-encode the entire file so it's __really__ fast.

    ```bash
    ffmpeg -i great_movie.mp4 -i great_movie.en.srt -c copy -c:s mov_text great_movie_subbed.mp4
    ```

    ---

    Another solution : https://www.reck.dk/use-ffmpeg-to-add-subtitles-to-video/

    ```bash
    ffmpeg -i great_movie.mp4 -i great_movie.en.srt -map 0:0 -map 0:1 -map 1:0 -c:v copy -c:a copy -c:s mov_text great_movie_subbed.mp4
    ```
  2. @gmolveau gmolveau revised this gist Apr 18, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion embed_sub.md
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,7 @@ 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
    - subtitle = great_movie.english.srt

    ```bash
    ffmpeg -i great_movie.mp4 -i great_movie.en.srt -c copy -c:s mov_text great_movie_subbed.mp4
  3. @gmolveau gmolveau created this gist Apr 18, 2020.
    14 changes: 14 additions & 0 deletions embed_sub.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    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

    ```bash
    ffmpeg -i great_movie.mp4 -i great_movie.en.srt -c copy -c:s mov_text great_movie_subbed.mp4
    ```