MakeMKV seems to be working for me.
http://www.makemkv.com/forum2/viewtopic.php?f=3&t=224
Just extracts the non-trivial sized titles from a DVD, puts them un-transcoded in an MKV file. Includes default audio track and the subtitles tracks.
Also does blu-ray apparently (I don't have a drive)
Handbrake doesn't do what you're asking for but it's the best I've found so far for making painless, compressed copied of titles on commercial DVDs
http://handytutorial.com/install-handbrake-in-ubuntu-12-10-quantal/
That guides for 12.10, but it works just fine for 12.04 as well.
The bit that had me stumped was the package is called handbrake-gtk, not handbrake.
My first attempt with handbrake has compressed 40 minute extras video from a DVD from 1.3GB to 0.3 GB at > 100fps on my PC of, at this point, fairly obsolete power.
However the loss in quality was noticeable to my overly critical eye, but you can bump the quality easily by decreasing the quality slider by small amounts.
Softsubs
MP4 supports streaming text format subtitles, but playback support for this among players and devices is not universal.
Basic example using default stream selection behavior while stream copying the audio:
ffmpeg -i input.mkv -c copy -c:s mov_text output.mp4
Example to stream copy all of the video and audio streams, convert the all text based subtitle input streams (SRT, ASS, VTT, etc) to the streaming text format, and set the language for the first two subtitle streams.
ffmpeg -i input.mkv -map 0 -c copy -c:s mov_text -metadata:s:s:0 language=eng -metadata:s:s:1 language=ipk output.mp4
Same as above but re-encode the video and audio to formats compatible with the MP4 container (H.264 video:
ffmpeg -i input.mkv -map 0 -c:v libx264 -c:a aac -c:s mov_text -metadata:s:s:0 language=eng -metadata:s:s:1 language=ipk output.mp4
Same as above but use the -map
option to choose the first video stream, second audio stream, and third subtitle stream:
ffmpeg -i input.mkv -map 0:v:0 -map 0:a:1 -map 0:s:2 -c:v libx264 -c:a aac -c:s mov_text -metadata:s:s:0 language=eng output.mp4
Hardsubs
Text based subtitle format inputs
Use the subtitles filter to "burn-in" text based subtitle formats (SRT, ASS, VTT, etc). Note that this requires re-encoding, so it will by much slower than using softsubs.
Basic example using default stream selection behavior while stream copying the audio:
ffmpeg -i input.mkv -filter_complex "subtitles=input.mkv" -c:a copy output.mp4
Example to use the third video stream, fifth subtitle stream, and first audio stream:
ffmpeg -i input.mkv -filter_complex "[0:v:2]subtitles=input.mkv:si=4[v]" -map "[v]" -map 0:a:0 -c:a copy output.mp4
Example for a separate subtitle input file (your-subtitles-file.srt
):
ffmpeg -i input.mp4 -filter_complex "subtitles=your-subtitles-file.srt" -c:a copy output.mp4
Image based subtitle format inputs
Use the overlay filter. This example will overlay the fourth subtitle stream over the second video stream, and stream copy the seventh audio stream:
ffmpeg -i input.mkv -filter_complex "[0:v:2][0:s:3]overlay[v]" -map "[v]" -map 0:a:6 -c:a copy output.mp4
Also see
Best Answer
You can use Handbrake.
To install, just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command(s) below:
Or you can use Synaptic to install it.
To convert mMP4 to MKV, follow the steps below:
Click on the movie like icon, to choose the MP4 file to be converted.
Click on the file to select it
Make sure the output type is mkv, and then click on the green button to start the conversion.