LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to add subtitles to a mp4 file permanently? (https://www.linuxquestions.org/questions/linux-software-2/how-to-add-subtitles-to-a-mp4-file-permanently-4175624316/)

milhan 02-23-2018 10:56 AM

How to add subtitles to a mp4 file permanently?
 
Hi,
How do you add subtitles to video file permanently in Linux?

Emerson 02-23-2018 11:13 AM

Try this.
Code:

ffmpeg -i inputfile.mp4 -vcodec copy -acodec copy -i input_subfile.srt -scodec mov_text -map 0:0 -map 0:1 -map 1:0 -y outfile.mp4

BW-userx 02-23-2018 12:11 PM

I've use handbrake and bake them into the file, but that requires re sampling them.

TB0ne 02-23-2018 12:35 PM

Quote:

Originally Posted by milhan (Post 5823247)
Hi,
How do you add subtitles to video file permanently in Linux?

Wrote something up a while back about using MKV's for this, and how to extract subtitles etc.
https://www.linuxquestions.org/quest...3/#post5239778

milhan 02-23-2018 01:22 PM

Quote:

Originally Posted by Emerson (Post 5823252)
Try this.
Code:

ffmpeg -i inputfile.mp4 -vcodec copy -acodec copy -i input_subfile.srt -scodec mov_text -map 0:0 -map 0:1 -map 1:0 -y outfile.mp4

Code:

Unknown decoder 'copy'

milhan 02-23-2018 01:26 PM

I used this command. It worked fine except it didn't save the background behind the text..

Code:

ffmpeg -i infile.mp4 -vf subtitles=subtitles.srt outfile.mp4

Gillian28 02-23-2018 06:04 PM

Try downloading the static build of ffmpeg from their download site.

Note, though, that mov_text seems to be a hit-and-miss situation; sometimes it works, sometimes it doesn't. You might have much better results re-muxing into a matroska container (.mkv), and play it using VLC.


All times are GMT -5. The time now is 05:36 AM.