python 视频格式转换 mob转MP4 python mkv转mp4_python


Video formats can be confusing, and some might not work in your video player of choice, especially more obscure formats like MKV. It’s often easier or even necessary to convert them to something more usable, like MP4. Luckily, that conversion is easy to do.

视频格式可能会造成混淆,某些视频格式可能无法在您选择的视频播放器中正常工作,尤其是MKV等较晦涩的格式。 将它们转换成更有用的东西(例如MP4)通常更容易,甚至必要。 幸运的是,这种转换很容易做到。

Note: We’re using macOS for our examples and screenshots in this article, but all the apps we’re using here work pretty much identically on Windows.

注意:本文中的示例和屏幕截图使用的是macOS,但此处使用的所有应用在Windows上的运行方式几乎相同。

(What are MKV Files, and Why Should I Convert Them?)

MKV is not a video format. Instead, it’s a multimedia container format used to combine different elements like audio, video, and subtitles into a single file. That means you could use any video encoding you want in an MKV file, and still have it play.

MKV不是视频格式。 相反,它是一种多媒体容器格式,用于将音频,视频和字幕等不同元素组合到一个文件中。 这意味着您可以在MKV文件中使用所需的任何视频编码,并且仍然可以播放。

The problem arises with compatibility. Not every device or video app can play MKV files, and that’s especially true on mobile devices. MKV is open source, and not an industry standard, so it doesn’t have support on many devices. It won’t even work in Windows Media Player or Quicktime, the defaults for Windows and macOS.

问题出现在兼容性上。 并非每个设备或视频应用程序都可以播放MKV文件,在移动设备上尤其如此。 MKV是开放源代码,而不是行业标准,因此它在许多设备上没有支持。 它甚至无法在Windows Media Player或Quicktime(Windows和macOS的默认设置)中运行。

The solution: Convert your MKV files to MP4. MP4 is compatible with most devices and apps, and you won’t lose much quality (if any) to the conversion process.

解决方案:将MKV文件转换为MP4。 MP4与大多数设备和应用程序兼容,并且转换过程不会损失太多质量(如果有的话)。

(The Simplest Solution: Use VLC)

VLC is an open source media player, one of the few that can play MKV, but it also has a hidden option for converting video.

VLC是一种开源媒体播放器,是可以播放MKV的少数几个媒体播放器之一,但它也具有用于转换视频的隐藏选项。


python 视频格式转换 mob转MP4 python mkv转mp4_python_02


From the “File” menu (or “Media” menu on Windows) choose the “Convert / Stream” option (or “Convert / Save” on Windows).

从“文件”菜单(或Windows的“媒体”菜单)中选择“转换/流”选项(或Windows的“转换/保存”)。


python 视频格式转换 mob转MP4 python mkv转mp4_python_03


This doesn’t automatically convert what you’re watching, so you’ll have to drag the file into the window again. Afterward, you can choose the file format you want to use for saving; VLC supports most formats, but MP4 is the default.

这不会自动转换您正在观看的内容,因此您必须再次将文件拖到窗口中。 之后,您可以选择要用于保存的文件格式。 VLC支持大多数格式,但是MP4是默认格式。


python 视频格式转换 mob转MP4 python mkv转mp4_python_04


After selecting the format you want, just hit the “Save” button and select where you want to save the new file.

选择所需的格式后,只需单击“保存”按钮,然后选择要保存新文件的位置。

(A More Full-Featured Solution: WinX Video Converter)

While VLC performs a simple encode on a single file, there’s a lot more under the hood that you might want to control if you’re doing any video production work. For this, WinX VideoProc handles the job well.

虽然VLC在单个文件上执行简单的编码,但是如果您要进行任何视频制作工作,则可能需要控制很多其他内容。 为此,WinX VideoProc处理得很好。


python 视频格式转换 mob转MP4 python mkv转mp4_python_05


When you open it up, switch to the “Video” tab at the bottom, and the first screen you see asks you to drag media onto it. Drag your file in, and the rest of the controls will pop up.

打开它时,切换到底部的“视频”选项卡,然后看到的第一个屏幕要求您将媒体拖到其上。 将文件拖入其中,其余控件将弹出。


python 视频格式转换 mob转MP4 python mkv转mp4_大数据_06


You can also add entire folders of videos and bulk encode them all at once, but we’ll stick to a single video for now.

您还可以添加整个视频文件夹,然后一次全部批量编码,但是我们现在将只保留一个视频。

Again, the default conversion option is MP4, so we don’t have to change much there, but if you want to take a peek under the hood, you can double-click the profile to change the settings.

同样,默认的转换选项是MP4,因此我们不必在那里进行太多更改,但是如果您想窥探一下,则可以双击配置文件来更改设置。


python 视频格式转换 mob转MP4 python mkv转mp4_python_07


From here you can change many options, the notable ones being:

在这里,您可以更改许多选项,其中值得注意的是:

  • Image quality, to adjust the quality in each frame, and the encoding speed
  • Bitrate, to make files smaller at the cost of quality
  • Framerate, to convert down to 30 or 24fps video
  • Resolution and aspect ratio

There are also audio codec options, but audio makes up such a small part of the video it’s worth keeping it on high settings.

也有音频编解码器选项,但是音频只占视频的一小部分,值得将其设置为高设置。

Once you’re done configuring, you can hit “Run” to start the conversion.

配置完成后,您可以点击“运行”以开始转换。


python 视频格式转换 mob转MP4 python mkv转mp4_大数据_08


Video conversion can take a while, especially with larger videos, but when it’s done the app will automatically open up the folder where it saved your files.

视频转换可能需要一段时间,尤其是较大的视频时,但是完成此应用后,该应用将自动打开保存文件的文件夹。

(Open Source Alternatives)

WinX is shareware, and while you can do a lot of things with the trial version, the full app is locked down unless you pay for the premium version. If you want the same level of customization for free, it’s worth trying Handbrake.

WinX是共享软件,尽管您可以使用试用版做很多事情,但是除非您为高级版付费,否则完整的应用程序将被锁定。 如果您想要免费获得相同级别的定制,那么值得尝试Handbrake


python 视频格式转换 mob转MP4 python mkv转mp4_java_09


Handbrake is a little more streamlined, but its interface can be a bit confusing. With so many options and buttons, it’s a little hard to figure out which one does what, but the basic ones you need to know are the presets (which affect the quality and encoding speed) and the format (which defaults to MP4 like the others).

手刹更加简化,但其界面可能会有些混乱。 有这么多的选项和按钮,要弄清楚哪个选项和按钮有点困难,但是您需要了解的基本信息是预设(影响质量和编码速度)和格式(默认格式为MP4,就像其他格式一样) )。

Handbrake has a nice queue for lining up multiple encodes but doesn’t have the same option to encode entire folders as WinX does. However, you can add multiple files individually, and then add them all to the queue. It’s still useful though since encoding very large files can sometimes take hours depending on your computer’s specs.

Handbrake有一个排队多个编码的不错的队列,但是没有像WinX一样对整个文件夹进行编码的选项。 但是,您可以单独添加多个文件,然后将它们全部添加到队列中。 尽管它仍然很有用,因为根据计算机的规格,对超大文件进行编码有时可能要花费数小时。

Image Credits: Halay Alex/Shutterstock

图片来源:Halay Alex / Shutterstock

翻译自: https://www.howtogeek.com/361973/how-to-convert-mkv-videos-to-mp4/