10

I have a mp4 video which is 18.5GB, it doesn't has any appreciable quality, and it runs for 2hours and 40 minutes.

recently I came across a movie which was saved in mkv format and was of the same time and better quality and it was only of 0.78GB, I am using openshot, can any suggest me any other app or show me the way to convert mp4 into mkv?

7
  • If you done convert file from 18.5Gib to [even] -10Gib, please tell me know that too. thank you Jan 12, 2015 at 12:01
  • @KasiyA i think the final file would be of 9 gb as the video is 50% enconded till this time and it is 4.6 gb at that instant, so i think it would do the job Jan 12, 2015 at 13:06
  • Alright. thanks again. and what about @Toroidal's answer? did you try it? Jan 12, 2015 at 13:30
  • 2
    Converting from mp4 to mkv won't change the filesize and/or quality. mp4 and mkv are containers. It sounds like you need to transcode the contents, increasing the compression and/or using a more space efficient codec.
    – NGRhodes
    Jan 12, 2015 at 13:30
  • 1
    @KasiyA yes i did, but the task would long for 7 and a 1/2 hours so i left it midway Jan 12, 2015 at 15:45

5 Answers 5

12

Download and install VLC player with one of the options provided here: http://www.videolan.org/vlc/download-ubuntu.html

Then run it by executing this command in Terminal:

vlc

Then once the program is open go "Media > Convert / Save...":

"Media > Convert / Save..." option

And in this interface which comes up click the "Add" button and locate the MP4 file which you wish to convert:

Open Media window

Then select the "Convert / Save" option at the bottom which now becomes enabled (not greyed out). Next select the profile "Video - H.264 + MP3 (MP4)" and then click on the little tool icon next to the pull-down menu and make sure that the option "MKV" is selected and not the default "MP4/MOV" like this:

Profile edition options

Then click the "Save" button at the bottom left. Then select the destination to where you want VLC player to export the file to and press "Start". Ignore any errors telling you about encoding problems. The progress bar which normally shows how far into the program you are will now show the progress of the conversion. When the progress bar has finished, your video will have been converted and ready to play.

12

It is very simple, I tried and got succeed using the below ffmpeg command

ffmpeg -i input.mp4 -vcodec copy -acodec copy output.mkv

10

You can use Handbrake.

HandBrake is an open-source, GPL-licensed, multiplatform, multithreaded video transcoder, available for MacOS X, Linux and Windows.Launchpad

To install, just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command(s) below:

sudo add-apt-repository ppa:stebbins/handbrake-releases
sudo apt-get update
sudo apt-get install handbrake-gtk

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.

enter image description here

Click on the file to select it

enter image description here

Make sure the output type is mkv, and then click on the green button to start the conversion.

enter image description here

8
  • 1
    handbrake-releases is known to be buggy. As an alternative, use the commands above, but change "/handbrake-releases" to "/handbrake-snapshots". Both will do MP4 and MKV, but the -snapshots version has more options
    – Drac Noc
    Jan 11, 2015 at 15:40
  • Why use any ppa at all? handbrake is in the universe-repository (from 14.04 at least) and works without a hitch. I've never had a problem with handbrake since I switched to it.
    – MadMike
    Jan 11, 2015 at 16:31
  • @mitch can you show me how to export a mp4 video to mkv using handbrake Jan 12, 2015 at 10:41
  • 1
    @agharehanabbas see additions in my answer.
    – Mitch
    Jan 12, 2015 at 11:22
  • @Mitch i think there is a typo in your last terminal command, i thinks it is -gtk instead of -gtk1, but any ways i have done it Jan 12, 2015 at 12:54
4

First, install avconv

sudo apt-get install libav-tools

Next, translate via command line

avconv -i filme.mp4 -c copy filme.mkv

Converting this way produces a file with a similar size. We need do add extra options to define what transformations should be done to reduce space. (See avconv -h)

0

mkvmerge (of MKVToolNix) can be used for multiplexing into MKV:

mkvmerge --output FILE.mkv  FILE.mp4

Note that the output file (MKV) has to precede the input file (MP4) in the command.

1
  • I've noted that the question is essentially about encoding, but the body text is unclear and implausible.
    – user598527
    Jun 13, 2023 at 17:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .