Translate

Sunday, November 20, 2022

Ubuntu - media, from iso to mp4/mkv


This is a brief note to describe how to solve a problem.


After reinstalling my media server I decided to do some spring cleaning.

I did find many movies I did record years ago and created as iso image.

In this way unfortunately is not easy to see them directly on Plex, the best way is to convert them in mp4 (or mkv).

So how to proceed ?

Of course all this discussion is Linux centered, specifically using Ubuntu 22.04 LTS
I will use two tools :

Let start to install Handsbrake and the Mkvtoolkit if not already done.

The first thing is to extract the movie from the iso file, to do so Handbrake is used.

Open Handbrake and Open Source over the iso image.
Depending the way the iso file was prepared, there are usually multiple short blocks.
Extract of all them.

We'll end up with a bunch of mp4 or mkv files.

The second phase is to join all of them together and the tool to do so is called mkvmerge (from the mvtoolkit)

From a terminal  the better way is to go on the directory where the blocks are stored, then the syntax to use is :

mkvmerge -o <output_file_name> <input_file_1> \+ <input_file_2> .... \+ <input_file_x>

After some tests I can say that is better to keep the same format of the input.
Converting in different format can bring some problems when played the join.

Here an example of merge of a file stored in 6 blocks, named film0.m4v to film6.m4v, the result in a film called  :

thefwguy@Milo:~/Videos$ mkvmerge -o lockness.m4v lockNess0.m4v \+ lockNess1.m4v \+ lockNess2.m4v \+ lockNess3.m4v \+ lockNess4.m4v \+ lockNess5.m4v \+ lockNess6.m4v
mkvmerge v45.0.0 ('Heaven in Pennies') 64-bit
'lockNess0.m4v': Using the demultiplexer for the format 'QuickTime/MP4'.
'lockNess1.m4v': Using the demultiplexer for the format 'QuickTime/MP4'.
'lockNess2.m4v': Using the demultiplexer for the format 'QuickTime/MP4'.
'lockNess3.m4v': Using the demultiplexer for the format 'QuickTime/MP4'.
'lockNess4.m4v': Using the demultiplexer for the format 'QuickTime/MP4'.
'lockNess5.m4v': Using the demultiplexer for the format 'QuickTime/MP4'.
'lockNess6.m4v': Using the demultiplexer for the format 'QuickTime/MP4'.
'lockNess0.m4v' track 0: Using the output module for the format 'AVC/H.264'.
'lockNess0.m4v' track 1: Using the output module for the format 'AAC'.
'lockNess1.m4v' track 0: Using the output module for the format 'AVC/H.264'.
'lockNess1.m4v' track 1: Using the output module for the format 'AAC'.
'lockNess2.m4v' track 0: Using the output module for the format 'AVC/H.264'.
'lockNess2.m4v' track 1: Using the output module for the format 'AAC'.
'lockNess3.m4v' track 0: Using the output module for the format 'AVC/H.264'.
'lockNess3.m4v' track 1: Using the output module for the format 'AAC'.
'lockNess4.m4v' track 0: Using the output module for the format 'AVC/H.264'.
'lockNess4.m4v' track 1: Using the output module for the format 'AAC'.
'lockNess5.m4v' track 0: Using the output module for the format 'AVC/H.264'.
'lockNess5.m4v' track 1: Using the output module for the format 'AAC'.
'lockNess6.m4v' track 0: Using the output module for the format 'AVC/H.264'.
'lockNess6.m4v' track 1: Using the output module for the format 'AAC'.
No append mapping was given for the file no. 1 ('lockNess1.m4v'). A default mapping of 1:0:0:0,1:1:0:1 will be used instead. Please keep that in mind if mkvmerge aborts with an error message regarding invalid '--append-to' options.
No append mapping was given for the file no. 2 ('lockNess2.m4v'). A default mapping of 2:0:1:0,2:1:1:1 will be used instead. Please keep that in mind if mkvmerge aborts with an error message regarding invalid '--append-to' options.
No append mapping was given for the file no. 3 ('lockNess3.m4v'). A default mapping of 3:0:2:0,3:1:2:1 will be used instead. Please keep that in mind if mkvmerge aborts with an error message regarding invalid '--append-to' options.
No append mapping was given for the file no. 4 ('lockNess4.m4v'). A default mapping of 4:0:3:0,4:1:3:1 will be used instead. Please keep that in mind if mkvmerge aborts with an error message regarding invalid '--append-to' options.
No append mapping was given for the file no. 5 ('lockNess5.m4v'). A default mapping of 5:0:4:0,5:1:4:1 will be used instead. Please keep that in mind if mkvmerge aborts with an error message regarding invalid '--append-to' options.
No append mapping was given for the file no. 6 ('lockNess6.m4v'). A default mapping of 6:0:5:0,6:1:5:1 will be used instead. Please keep that in mind if mkvmerge aborts with an error message regarding invalid '--append-to' options.
The file 'lockness.m4v' has been opened for writing.
Appending track 0 from file no. 1 ('lockNess1.m4v') to track 0 from file no. 0 ('lockNess0.m4v').
Appending track 1 from file no. 1 ('lockNess1.m4v') to track 1 from file no. 0 ('lockNess0.m4v').
Appending track 0 from file no. 2 ('lockNess2.m4v') to track 0 from file no. 1 ('lockNess1.m4v').
Appending track 1 from file no. 2 ('lockNess2.m4v') to track 1 from file no. 1 ('lockNess1.m4v').
Appending track 0 from file no. 3 ('lockNess3.m4v') to track 0 from file no. 2 ('lockNess2.m4v').
Appending track 1 from file no. 3 ('lockNess3.m4v') to track 1 from file no. 2 ('lockNess2.m4v').
Appending track 0 from file no. 4 ('lockNess4.m4v') to track 0 from file no. 3 ('lockNess3.m4v').
Appending track 1 from file no. 4 ('lockNess4.m4v') to track 1 from file no. 3 ('lockNess3.m4v').
Appending track 1 from file no. 5 ('lockNess5.m4v') to track 1 from file no. 4 ('lockNess4.m4v').
Appending track 0 from file no. 5 ('lockNess5.m4v') to track 0 from file no. 4 ('lockNess4.m4v').
Appending track 0 from file no. 6 ('lockNess6.m4v') to track 0 from file no. 5 ('lockNess5.m4v').
Appending track 1 from file no. 6 ('lockNess6.m4v') to track 1 from file no. 5 ('lockNess5.m4v').
Progress: 100%
The cue entries (the index) are being written...
Multiplexing took 3 seconds.


No comments:

Post a Comment