2

I’ve been using ffmpeg to do everything so far with a video, stringing animation frames together, adding audio, overlaying images, and adding subtitles. So I expect that the answer to my question still lies within ffmpeg, but I’m open to using other programs if necessary.

I already created the ASS subtitle files (plural for multiple languages), taking advantage of the font, color, and positioning info. But when I went to add one of them to the video it lost all of that formatting info. The only way I’ve found to preserve that information with ffmpeg is to hard-sub, rendering the text permanently into the video, but I want the viewer to be able to switch between languages.

This is what I do currently:

ffmpeg \
-i video_in.mp4 -i sub_eng.ass -i sub_spa.ass \
-c copy -c:s mov_text \
-map 0:v -map 0:a -map 1 -map 2 \
-metadata:s:s:0 language=eng \
-metadata:s:s:1 language=spa \
video_out.mp4

Is there a way to soft-sub a video with position information? Each line in the subtitles has its own position (mimicking a speech bubble to denote who’s speaking).

EDIT: Partial Solution with MKV from Gyan

ffmpeg \
-i video_in.mkv -i sub_eng.ass -i sub_spa.ass \
-c copy \
-map 0:v -map 0:a -map 1 -map 2 \
-metadata:s:s:0 language=eng \
-metadata:s:s:1 language=spa \
video_out.mkv
3
  • Save as MKV and drop the subtitle encoding. MP4 does not support ASS and mov_text encoder has limited styling capabilities at present.
    – Gyan
    May 28, 2018 at 13:27
  • @Gyan Wow, that easy? Thanks! I just confirmed that your solution works. Are there file types other than MKV that support ASS? I’m looking to upload to youtube, which doesn’t allow MKV
    – owengall
    May 28, 2018 at 14:11
  • Not that I can see.
    – Gyan
    May 28, 2018 at 14:24

1 Answer 1

-1

I use this command:

map 0 -map 1 -metadata:s:s:0 language=eng -metadata:s:s:0 title=Subtitle 1 -c:a copy -c:v copy -c:s copy -c:s mov_text
1
  • 3
    Welcome to Super User! Could you please edit your answer to give an explanation of why this code answers the question? Code-only answers are discouraged, because they don't teach the solution.
    – DavidPostill
    Aug 9, 2021 at 9:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .