LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-23-2018, 10:56 AM   #1
milhan
LQ Newbie
 
Registered: Sep 2005
Location: usa
Distribution: Fedora, Ubuntu, SuSE 10.2 i686
Posts: 23

Rep: Reputation: 0
How to add subtitles to a mp4 file permanently?


Hi,
How do you add subtitles to video file permanently in Linux?
 
Old 02-23-2018, 11:13 AM   #2
Emerson
LQ Guru
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~arch
Posts: 6,311

Rep: Reputation: Disabled
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
 
Old 02-23-2018, 12:11 PM   #3
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: MID-SOUTH USA
Distribution: Slackware 14.2 / Slackware 14.2 current / Manjaro
Posts: 6,397

Rep: Reputation: 1238Reputation: 1238Reputation: 1238Reputation: 1238Reputation: 1238Reputation: 1238Reputation: 1238Reputation: 1238Reputation: 1238
I've use handbrake and bake them into the file, but that requires re sampling them.
 
Old 02-23-2018, 12:35 PM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 20,270

Rep: Reputation: 4902Reputation: 4902Reputation: 4902Reputation: 4902Reputation: 4902Reputation: 4902Reputation: 4902Reputation: 4902Reputation: 4902Reputation: 4902Reputation: 4902
Quote:
Originally Posted by milhan View Post
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
 
Old 02-23-2018, 01:22 PM   #5
milhan
LQ Newbie
 
Registered: Sep 2005
Location: usa
Distribution: Fedora, Ubuntu, SuSE 10.2 i686
Posts: 23

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Emerson View Post
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'
 
Old 02-23-2018, 01:26 PM   #6
milhan
LQ Newbie
 
Registered: Sep 2005
Location: usa
Distribution: Fedora, Ubuntu, SuSE 10.2 i686
Posts: 23

Original Poster
Rep: Reputation: 0
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
 
Old 02-23-2018, 06:04 PM   #7
Gillian28
LQ Newbie
 
Registered: Dec 2017
Location: New York
Posts: 6

Rep: Reputation: Disabled
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.
 
  


Reply

Tags
add, subtitles, video


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help: Batch convert from MKV & embed subtitles to MP4 alhatmy Linux - Software 4 06-27-2017 04:41 PM
How do you permanently disable subtitles in video formats? Elessar Linux - General 7 03-28-2016 12:24 PM
Transcoding MKV files with embedded subtitles to MP4's with 'burned in' subtitles TB0ne LinuxQuestions.org Member Success Stories 0 09-17-2014 11:45 AM
Set Totem subtitle to "None" or remove subtitles from mp4? jsteel Linux - General 6 08-16-2014 09:40 AM
How to Add Subtitles to Divx file with Option to turn it On or Off RedNeck-LQ Linux - General 2 02-12-2011 05:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration