I use this batch file to add hard coded .srt subtitles to an MP4 video.
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.Code: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 A.srt -map 0:0 -map 0:1 -map 1:0 -c:v copy -c:a copy -c:s mov_text out.mp4 EXIT
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.
![]()
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 5 of 5
Thread
-
-
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 Selurusers currently on my ignore list: deadrats, Stears555 -
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.
-
Like I wrote, you would have to use another tool like 'Subtitle edit' to do that, afaik. ffmpeg can't.
Cu Selurusers currently on my ignore list: deadrats, Stears555
Similar Threads
-
Removing all positioning and formatting in .ass subtitle files?
By killerteengohan in forum SubtitleReplies: 4Last Post: 3rd Oct 2022, 23:20 -
Formatting the subtitle breaks in Subtitle Edit
By loninappleton in forum SubtitleReplies: 0Last Post: 18th Aug 2022, 16:11 -
Subtitle Edit has lost my formatting
By loninappleton in forum SubtitleReplies: 10Last Post: 25th Jul 2022, 12:50 -
Subtitle Edit: Is there an option to turn off special formatting?
By Amoun in forum SubtitleReplies: 0Last Post: 19th Apr 2022, 21:13 -
How to Create a Batch File For Subtitle Downloading
By ridibunda in forum Video Streaming DownloadingReplies: 4Last Post: 6th Apr 2022, 14:33