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

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"' {} \;
```