VideoHelp Forum
+ Reply to Thread
Results 1 to 5 of 5
  1. I use this batch file to add hard coded .srt subtitles to an MP4 video.

    rem This batch file runs using ffmpeg.
    rem It adds built-in subtitles to the .mp4 video in the first path 
    rem taken from the .srt file in the second path
    rem It saves the new video with the amended audio as 'Out.mp4' in the third path
    rem amend paths and filenames as appropriate
    rem To run without full pathname , run this file in the directory where the Video and subtitles files are present.
    Echo Off
    ffmpeg -i A.mp4 -f srt -i -map 0:0 -map 0:1 -map 1:0 -c:v copy -c:a copy -c:s mov_text out.mp4
    It works perfectly well , and hard codes the .srt subtitles into the .mp4. However , it ignores any formatting codes which the .srt may hold. So bold / italic / colours etc. commands aren't reflected in the hard coded video.

    I do know that ffmpeg can do this , it's just a question of sending the right commands.

    Can someone suggest a way to modify the code so that formatting elements are included?

    Grateful for any advice.

    Quote Quote  
  2. a. ffmpeg and iirc. mp4box too, both do only a simple srt to ttxt (timed text) conversion without trying to add any of the styling (which was later added to the srt format).
    b. those subtitles are not hard coded, they are just muxed into the container.
    c. you would have to do the srt -> ttxt conversion outside of ffmpeg (for example with Subtitle edit) and then better use mp4box for muxing. (not sure whether ffmpeg supports timed text subtitles as input)

    Cu Selur
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  3. Ok thanks. I was trying to find a way to keep the formatting contained in the srt when hard-coding the text to the mp4. This would be so that bold , coloured , italic text would show in the mp4 once the mux was complete.
    Quote Quote  
  4. Like I wrote, you would have to use another tool like 'Subtitle edit' to do that, afaik. ffmpeg can't.

    Cu Selur
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  5. OK thanks - I'll give Subtitle Edit a try.

    Quote Quote  

Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!