0

Requirement

I'm trying to add an ass subtitle file to a mp4 video. I want the text to use system/custom fonts and have a certain position.

My test

This is an example of my ass file:

[Script Info]
Title: Italiano
Original Script: my_it  [my_it]
Original Translation: 
Original Editing: 
Original Timing: 
Synch Point: 
Script Updated By: 
Update Details: 
ScriptType: v4.00+
Collisions: Normal
PlayResX: 640
PlayResY: 360
Timer: 0.0000
WrapStyle: 0

[V4+ Styles]
Format: Name,Fontname,Fontsize,PrimaryColour,SecondaryColour,OutlineColour,BackColour,Bold,Italic,Underline,Strikeout,ScaleX,ScaleY,Spacing,Angle,BorderStyle,Outline,Shadow,Alignment,MarginL,MarginR,MarginV,Encoding
Style: Dialogue,Trebuchet MS,22,&H00FFFFFF,&H000000FF,&H00000000,&H00000000,0,0,0,0,100,100,0,0,1,2,0,2,0010,0010,0015,0

[Events]
Format: Layer,Start,End,Style,Name,MarginL,MarginR,MarginV,Effect,Text
Dialogue: 0,0:00:01.98,0:00:08.48,Luoghi,,0000,0000,0000,,{\fad(500,525)\shad1\pos(315,255)}Alexandrovsk-Sakhalinsky\N(Akou)

If if reproduce the video Clean.mp4 with the subtitles file Clean.ass in the same directory, the subtitles areshown correctly. Subtitles OK - Separate files

Instead if I try to add the ass file to the mp4 container the subtitle are no more shown correctly. The ffmpeg command I used is: ffmpeg.exe -i Clean.mp4 -i Clean.itIT.ass -c copy -c:s mov_text add_sub.mp4 Subtitles KO - Add stream

I have ffmpeg with this settings: --enable-fontconfig.

Constraints

  • Cannot change video container, I need an mp4 file (no mkv)
  • Cannot impress the subtitles (no hardsub)
  • Have a single file with video, audio and subtitle in it.

Is it possible to have the requested result with thiese constraints?

1 Answer 1

0

you can use this command:

ffmpeg.exe -i input.srt -c copy -c:s mov_text output.mkv

then:

ffmpeg.exe -i input.mkv -c copy -map 0 -c:s mov_text output.mp4
1
  • Unfortunately I need to mantain custom fonts and size. The limitation is due to mov_text, it does not support customization, only plain text
    – Timmy
    May 5, 2022 at 14:55

You must log in to answer this question.

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