Hey there,
Apologies for the long wait, I missed your question, so hopefully I'm still somewhat on time.
We've got an article on the question here:
Using the code there for 720p, 480p and 360p you can adapt that to fit the other resolutions:
```
ffmpeg -loglevel quiet -hide_banner -fflags nobuffer -i - -map v:0 -map v:0 -map v:0 -map v:0 -map a:0 -c:v:0 copy -c:v:1 h264 -b:v:1 2000k -s:v:1 1280x720 -c:v:2 h264 -b:v:2 1000k -s:v:2 854x480 -c:v:3 h264 -b:v:3 500k -s:v:3 640x360 -c:a:0 copy -force_key_frames source -bf 0 -cluster_time_limit 0 -preset ultrafast -f matroska -
```
The thing would be to add a `-map v:0` per resolution you want to add, and make sure to set the `-b:v:# ` and `-s:v:#` per additional quality.
Here would be one for 1080p, 720p and 480p (imo the 360p is a bit redundant).
```
ffmpeg -loglevel quiet -hide_banner -fflags nobuffer -i - -map v:0 -map v:0 -map v:0 -map v:0 -map a:0 -c:v:0 copy -c:v:1 h264 -b:v:1 5000k -s:v:1 1920x1080 -c:v:2 h264 -b:v:2 2000k -s:v:2 1280x720 -c:v:3 h264 -b:v:3 1000k -s:v:3 854x480 -c:a:0 copy -force_key_frames source -bf 0 -cluster_time_limit 0 -preset ultrafast -f matroska -
```
Do note that this task can be heavy on the CPU, so if hardware encoding such as `nvenc` or `h264_qsv` is available you will most likely want to consider it.
With kind regards,
Balder Viëtor
Head of Testing
MistServer