FFMPEG: convert MP4 to same MP4 (in a different container) and add Subtitles

1

The main reason for this post is that I have movie.mp4 that I have downloaded an SRT for. When I manually add the SRT VLC uses its settings to change the font/size etc of the SRT. But if I Embed the subtitle file, it no longer works. I have found this is an issue with mp4/mov_text!

It is possible to Embed subtitles into MP4 BUT I have found out that VLC ignores subtitle Settings for MP4 and Can't see soft-coded subtitles of MP4

I want to convert

movie.mp4

to

movie.mkv

Without re-encoding (LossLess) & Add subtitles.

FreeSoftwareServers

Posted 2015-10-15T05:04:14.690

Reputation: 962

I am pretty ridiculous, I hate having 2 files (srt and mp4), so my only solution is too convert to MKV. The simple matter is that embedded mp4 subtitles don't work well and you are better off just adding them manually from downloaded SRT or following my guide to convert to MKV loselessly – FreeSoftwareServers – 2015-10-15T05:49:58.113

Answers

3

This command will not work with a mp4 with embedded subtitles & extracting subtitles from an Mp4 will result in MOV_TEXT style subtitle file, which is not what you want. Basically, google for an SRT, test it out and then we are ready to go.

If you have embedded SRT you also need a seperate file with just video and audio. To strip the srt streams, leaving the just video and audio you want.

Example:

ffmpeg -i movie.mp4 -map 0:0 -vcodec copy -map 0:1 -acodec copy movienosubs.mp4

So lets assume you now have

subtitle.srt
movienosubs.mp4

The FFMPEG command would be this: (Note this only copies the first audio stream, you may need to mess around with mapping streams if you wan't to get more complicated, but you get the idea)

ffmpeg -i movienosubs.mp4 -i subtitle.srt -c:v copy -c:a copy -c:s copy movieFINAL.mkv

FreeSoftwareServers

Posted 2015-10-15T05:04:14.690

Reputation: 962

My FFMPEG script here @ FFMPEG SCRIPT

– FreeSoftwareServers – 2015-10-15T06:04:59.217

3

MKV file is a container in which you may put video, audio and text(subtitle). If you have difficulty with command line ffmpeg tool (as already suggested), you may try GUI tools such as MKVToolnix. There is no re-encoding during this proces, it's practically copying only.

toejoe

Posted 2015-10-15T05:04:14.690

Reputation: 31

+1. Not because it is a proper answer, but because it touches a key issue. Namely the title asks something not possible. Maybe it should read 'convert MP4 to same MP4 (in a different container)'. – Hennes – 2015-10-15T12:12:49.417

Changed to your Title, I get what you are saying, I am wrapping the MP4 in another container basically, but hey, it gets the job done! I only have one file! – FreeSoftwareServers – 2015-11-29T01:30:46.587

0

You can use my program dmMediaConverter (which is a FFmpeg GUI exposing some of its features), it does just that, you can copy all the streams without transcoding. http://dmsimpleapps.blogspot.ro/2014/04/dmmediaconverter.html

enter image description here

mdalacu

Posted 2015-10-15T05:04:14.690

Reputation: 121

1You might want to add that dmMediaConverter actually uses FFmpeg. It is merely (a handy!) frontend for some of its features. – Hennes – 2015-10-15T12:14:25.520

Yes you are right, i have corrected my post....btw that was stated on my site in the first line. ;) – mdalacu – 2015-10-15T12:56:48.600

1I know, I looked. And the logo in the right lower corner was also a rather big hint. Still, we try to avoid link rot on the SE sites, which means putting all relevant details in the answer rather than 'see this site' or 'google on this'. – Hennes – 2015-10-15T13:00:47.970