We tell ffmpeg to copy the audio/video streams (no transcoding or quality loss) and to convert any subtitle streams into mov_text since that is the only type that mp4 container supports. The following would take an input mp4 (or other) file and a second srt input file, take all streams from both files and mux them into a new output.mp4 file. How to mux multiple inputs into a single mp4 container For Mac/Linux it has always been easy to install and run these tools. Windows Services for Linux makes this easier than ever for windows users on Windows 10. If you are semi-technical and do lots of video work it is worth learning how to use the command line on your OS and how to use tools like this. The command line options can be confusing but once you understand how to use the -map and -codec options, you can already do a lot. ffmpegįfmpeg is a very powerful free/opensource tool. Plex and VLC and most other modern media players have no trouble with MKV right out of the box.so something to think about whether you really want to use mp4 if you are someone that cares about soft-subtitles and keeping everything together (single file). but I don't share over the network and hard-disk space is cheap.
Yes overall file size is larger for people that don't care about those extra audio/subs. It allows me to easily maintain multiple audio and subtitle streams with many different formats all within a single file (keep everything together).
This is one of the reasons that I prefer the mkv container format over mp4. So we have to transcode the SRT to mov_text or use hard-coded subs (where the subtitle text is encoded into the video stream directly and cannot be turned off). You should know that the MP4 container does not support embedded srt (subrip) streams. MP4 vs MKV container - limitations of mp4 If you have unknown stream types, multiple subtitle streams, or other things going on then this may not work and you might need to revise the options. Short Answerįor a single input mp4 file and single input SRT file, we can keep all streams from both files and merge them into a new mp4 container (only transcoding the subtitle stream.ie lossless on the audio/video) like this: ffmpeg MoritzLost has the key point but as ffmpeg options can be quite difficult to sort out when you are first getting started, here is a more detailed answer. I just went through a very similar use-case working with TS files.