aboutsummaryrefslogtreecommitdiff
path: root/_posts/notes/2023-05-14-convert-mkv.md
blob: 7cc6189ef6005f2c5bf238c27fd7c2ffdcc56527 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
---
title: Convert all MKV files into other formats
permalink: /convert-mkv.html
date: 2023-05-14T12:00:00+02:00
layout: post
type: note
draft: false
tags: [ffmpeg]
---

You will need `ffmpeg` installed on your system. This will convert all MKV files
into WebM format.

```sh
# Convert all MKV files into WebM format.
find ./ -name '*.mkv' -exec bash -c 'ffmpeg -i "$0" -vcodec libvpx -acodec libvorbis -cpu-used 5 -threads 8 "${0%%.mp4}.webm"' {} \;
```

```sh
# Convert all MKV files into MP4 format.
find ./ -name '*.mkv' -exec bash -c 'ffmpeg -i "$0" c:a copy -c:v copy -cpu-used 5 -threads 8 "${0%%.mp4}.mp4"' {} \;
```