November 17, 2019
mkvtomp4.py - convert H.264 mkv files to mp4 files playable on the PS3
mkvtomp4.py OPTIONS [--] <mkvfile>
mkvtomp4.py --correct-profile-only [--] <rawh264file>
Uses existing tools to convert troublesome mkv files to mp4, that is playable on the PS3. The conversion does not re-encode H.264 video. If the H.264 profile level is not supported by the PS3, we rewrite just some profile level information. The default value is 4.1, but it can be set with --profile-level=4.0
, etc. The conversion only re-encodes audio if it doesn’t already use AAC. The resulting mp4 will be playable on the Sony PS3, and similar devices. Tested on profile levels 3.x and 4.x,
Note that the PS4 Media Player has better support for mkv than mp4 (subtitles work only on mkv).
We depend on: mkvtoolnix and GPAC’s MP4Box for the conversion. ffmpeg is only required if doing audio transcoding and subtitles.
<outfile>
.
<mp4box>
as the MP4Box command.
<ffmpeg>
as the ffmpeg command.
<mkvinfo>
as the mkvinfo command.
<mkvextract>
as the mkvextract command.
<video_track>
from the mkv file instead of trying to parse it.
<audio_track>
from the mkv file instead of trying to parse it.
<delay_ms>
milliseconds. e.g., --audio-delay-ms
=1000
delays by 1 second. Only supported by mp4box.
128
.
<channels>
channels in the output. e.g., 5.1
.
<codec>
. Default is aac
. This should be something supported by ffmpeg.
<subtitle_track>
from the mkv file instead of trying to parse it.
<mkvfile>
.
<mkvfile>
.
<mkvfile>
.
Gavin Beatty public@gavinbeatty.com
Website: http://github.com/gavinbeatty/mkvtomp4/
Please report all bugs and wishes to public@gavinbeatty.com
mkvtomp4 Copyright (c) 2012, 2013, 2019 Gavin Beatty, public@gavinbeatty.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.