Advanced output mode allows creating a file with multiple audio tracks - for example, you could livestream your game's audio and your microphone, and also record your system sounds, game audio, and microphone into 3 separate tracks for video editing. (Capturing per-application audio will be added to OBS Studio in the future; currently, the win-capture-audio plugin can be installed for this.)
Contents:
1. How to use multiple audio tracks
2. How to control quality and file size
3. How to calculate bit rates and file sizes for VBR and CBR
4. Other semi-important settings
1. How to use multiple audio tracks
Go to Settings > Output > Recording, choose your preferred container format (MKV is highly recommended, as it is crash-safe, and can be remuxed to MP4 for video editors later), then choose how many tracks to record.
I will use 4 tracks for demonstration:
- Livestream (game audio + mic)
- Game audio only
- Mic audio only
- Speakers
That's 4 tracks, so 4 checkboxes need to be ticked. On the Audio tab, tracks can be renamed for convenience, and their bit rates can be changed.
After 4 tracks have been selected, the next step is to assign which audio sources need to be recorded into which tracks. This is done in the Edit > Advanced Audio Properties menu.
In this configuration, game audio will go to tracks 1 and 3, microphone will go to tracks 1 and 2, and speakers' audio will go to track 4. Since tracks 5 and 6 were not checked in Settings > Output > Recording, their checkboxes will not affect anything.
Most video players will let you choose only one track to play during playback:
In mpv, left-click or right-click on the audio icon in the on-screen controls, or press # (Shift+3 on US English keyboard layouts)
In Media Player Classic-based players, go to the Play menu > Audio Track, and click on a track.
In VLC, go to the Audio menu > Audio track, and click on a track.
Most video editors should import all the tracks automatically. Or, if they don't, you can manually extract them into separate files with MKVToolNix GUI or mkvextract.
2. How to control quality and file size
The video encoders available in OBS Studio offer all of the following rate control methods: CBR, VBR and CQP (or CRF in the case with x264).
For livestreaming over the internet, you should always be using CBR as your rate control mode, as it allows for a stable connection with consistent latency. However, it is not necessary for local recording and will usually waste a lot of disk space, so it's preferable to use CQP or VBR instead.
CQP (Constant Quantization Parameter) uses a flat compression ratio without regard to bit rates. This means it will always yield a certain level of quality, and the bit rate will vary based on the video's contents. If you have a lot of free disk space, this is the preferred method for best video quality, its only downside is that file sizes can be somewhat unpredictable.
VBR (Variable Bit Rate) uses a bit rate target. It will change the compression ratio to stay under your bit rate limit. This is useful if you have limited disk space and want predictable file sizes, but quality may be somewhat unpredictable and there can be moments of visible quality loss.
CRF (Constant Rate Factor) is unique to the x264 encoder, and works similar to CQP, but it makes some adjustments to account for human perception, improving perceived quality slightly.
Choosing the QP value in CQP mode is straightforward: lower values yield higher quality and larger files, higher values yield lower quality and smaller files. Increasing the QP value by +6 will cut file size approximately in half. To get an idea of what kind of bit rates you'll end up with, you'll need to do a test recording of the content (applications, games) that you want to record, then decide if you need to adjust the QP value. If you're not sure what QP value to start with, start with 18. Please also note that since CQP doesn't care about bit rates, it's possible to end up with bit rates so high that your storage device will fail to write fast enough. This is usually extremely obvious - those parts of the video will show massive artifacts when played in a video player. For reference, most modern hard drives can sustain write speeds of around 100 to 140 MBps, or 800 to 1120 Mbps.
Choosing the target bit rate in VBR mode is also straightforward: higher bit rates will yield better quality. The "Max Bitrate" setting, also known as "Peak Bitrate" or "Buffer Size", should typically be set to 2 times your target bit rate to help conceal quality loss in scenarios where the complexity of motion in your video quickly goes up and compression ratios have to be increased, but this might also result in a slight bit rate overshoot in some scenarios. Note that VBR will not use all available bit rate if there's no need to - there is also a quality (QP) target, and if that target can be met at a lower bit rate, it will be lower. When using x264, you can see this quality target (as CRF), but other encoders will hide it.
When using x264, you can switch from CRF to CQP for a small performance boost by manually specifying the desired QP value in the "x264 Options" field; for example, qp=20 will switch rate control mode to CQP and use a QP value of 20 (min. 0, max. 51 in Partial range, 63 in Full range)
3. How to calculate bit rates and file sizes for VBR and CBR
Let's say you want to know how many gigabytes per hour will be spent at a given bit rate. Here's how to calculate this:
First, take your total bit rate in kilobits per second (Kbps) and divide it by 8 to get kilobytes per second (KBps):
8000 Kbps / 8 = 1000 KBps
Then, multiply by 3600 seconds:
1000 KBps * 3600 seconds = 3600000 KB per hour
This is 3600 MB per hour, or 3.6 GB per hour. Now we know that recording at 8000 Kbps will result in files that are (at most) 3.6 GB per hour. Please don't forget that audio also has a bit rate and it should be added when doing these calculations, i.e. 8000 Kbps video + 5 audio tracks that are 160 Kbps each = 8800 Kbps.
The same calculations can be done backwards to figure out what bit rate you can record at and for how long, given your free disk space.
Let's say we have 50 GB free and want to record for at least 5 hours. That's 10 GB per hour.
10 GB (gigabytes) per hour = 80 Gb (gigabits) per hour, or 80000 Mb (megabits) per hour.
80000 Mb / 3600 = 22.222 Mbps, or 22222 Kbps. Again, note that audio bit rate must be accounted for.
It should also be noted that VBR can go lower than your target bit rate if it can achieve the target quality at a lower bit rate. CBR will not improve quality in this scenario, it will waste disk space with bit stuffing.
4. Other semi-important settings
A quick look at some other settings that may be worth changing (or why they shouldn't be changed):
- Keyframe interval (in seconds)
Higher values allow for better compression (smaller size and/or higher quality), lower values may improve performance in video players and video editors. A special value of 0 means "default", and the default is 250 frames (~4.1 seconds at 60 FPS, ~8.2 seconds at 30 FPS). Most video streaming platforms require 2 seconds for a compromise between quality and latency, and usually will not benefit from a shorter interval.
- Profile (baseline, main, high)
This is the H.264 profile. Nearly all computers and mobile devices made in the last 10 years should be capable of playing the High profile, so use that.
- GPU (for hardware encoders)
This should stay at 0 unless you have more than one graphics card with the same hardware encoder type.
- Max B-frames
More B-frames isn't always better; fast-paced games tend to get worse results with higher values. Usually not worth changing from the default value of 2.
NVENC only:
- Look-ahead, Psycho Visual Tuning
These will try to improve quality, at the cost of higher GPU usage.
- Profile
NVENC profile. The "Quality" (hq 1-pass) preset should be used nearly all the time. The "Max Quality" (hq pseudo-2-pass) preset uses more than double the resources for a slight quality gain on 1000 series NVIDIA cards or older, and for almost no benefit at all on 1600 series cards and newer. The "low latency" presets should not be used in livestreaming, as they only reduce latency by a few frames, at the cost of significantly worse quality. Here's a good demonstration of low latency vs. normal presets: https://cdn.knightlab.com/libs/juxt...html?uid=a8cb00ac-55c9-11eb-83c8-ebb5d6f907df
x264 only:
- CPU usage preset
OBS Studio uses the "veryfast" preset in Simple output mode, or "ultrafast" if you choose "x264 low CPU usage preset". A slower preset will improve compression, but also use more CPU resources.
- Tune
Tries to account for the type of content, but typically should not be changed.
AMF only:
- Peak Bitrate (VBR only)
This is the same as "Max bitrate" or "Buffer size".
- Quality preset
This should stay on "Balanced", somehow it seems to yield better performance than the "Speed" preset.
- P-frame QP, I-frame QP
AMF allows you to separately specify the QP values for I and P-frames. Using different values for different frame types usually doesn't significantly affect quality.
- View Mode
There's usually no good reason to use any option other than "Basic", as the other options unlock settings that do not yield any useful results. Touching most of the extra settings will reduce quality and/or performance, or introduce stability and compatibility issues.
QSV only:
- Target Usage
Similar to AMF, no reason to use anything other than "balanced".
- QPI, QPP, QPB
QuickSync allows you to separately specify the QP values for I, P and B-frames. Using different values for different frame types usually doesn't significantly affect quality.
- Max Bitrate (VBR only)
This is the same as "Peak Bitrate" or "Buffer size".
- Latency
This should stay on "normal", the other settings will only reduce latency by a few frames, but significantly reduce quality.
Found an error or want to submit other feedback re: this guide? Use the Discussion tab to leave a comment, or write to @Nakajima Megumi#7432 on the obs-studio Discord server if you want a faster response.
Need help? Visit the help channels in the obs-studio Discord server.
Contents:
1. How to use multiple audio tracks
2. How to control quality and file size
3. How to calculate bit rates and file sizes for VBR and CBR
4. Other semi-important settings
1. How to use multiple audio tracks
Go to Settings > Output > Recording, choose your preferred container format (MKV is highly recommended, as it is crash-safe, and can be remuxed to MP4 for video editors later), then choose how many tracks to record.
I will use 4 tracks for demonstration:
- Livestream (game audio + mic)
- Game audio only
- Mic audio only
- Speakers
That's 4 tracks, so 4 checkboxes need to be ticked. On the Audio tab, tracks can be renamed for convenience, and their bit rates can be changed.
After 4 tracks have been selected, the next step is to assign which audio sources need to be recorded into which tracks. This is done in the Edit > Advanced Audio Properties menu.
In this configuration, game audio will go to tracks 1 and 3, microphone will go to tracks 1 and 2, and speakers' audio will go to track 4. Since tracks 5 and 6 were not checked in Settings > Output > Recording, their checkboxes will not affect anything.
Most video players will let you choose only one track to play during playback:
In mpv, left-click or right-click on the audio icon in the on-screen controls, or press # (Shift+3 on US English keyboard layouts)
In Media Player Classic-based players, go to the Play menu > Audio Track, and click on a track.
In VLC, go to the Audio menu > Audio track, and click on a track.
Most video editors should import all the tracks automatically. Or, if they don't, you can manually extract them into separate files with MKVToolNix GUI or mkvextract.
2. How to control quality and file size
The video encoders available in OBS Studio offer all of the following rate control methods: CBR, VBR and CQP (or CRF in the case with x264).
For livestreaming over the internet, you should always be using CBR as your rate control mode, as it allows for a stable connection with consistent latency. However, it is not necessary for local recording and will usually waste a lot of disk space, so it's preferable to use CQP or VBR instead.
CQP (Constant Quantization Parameter) uses a flat compression ratio without regard to bit rates. This means it will always yield a certain level of quality, and the bit rate will vary based on the video's contents. If you have a lot of free disk space, this is the preferred method for best video quality, its only downside is that file sizes can be somewhat unpredictable.
VBR (Variable Bit Rate) uses a bit rate target. It will change the compression ratio to stay under your bit rate limit. This is useful if you have limited disk space and want predictable file sizes, but quality may be somewhat unpredictable and there can be moments of visible quality loss.
CRF (Constant Rate Factor) is unique to the x264 encoder, and works similar to CQP, but it makes some adjustments to account for human perception, improving perceived quality slightly.
Choosing the QP value in CQP mode is straightforward: lower values yield higher quality and larger files, higher values yield lower quality and smaller files. Increasing the QP value by +6 will cut file size approximately in half. To get an idea of what kind of bit rates you'll end up with, you'll need to do a test recording of the content (applications, games) that you want to record, then decide if you need to adjust the QP value. If you're not sure what QP value to start with, start with 18. Please also note that since CQP doesn't care about bit rates, it's possible to end up with bit rates so high that your storage device will fail to write fast enough. This is usually extremely obvious - those parts of the video will show massive artifacts when played in a video player. For reference, most modern hard drives can sustain write speeds of around 100 to 140 MBps, or 800 to 1120 Mbps.
Choosing the target bit rate in VBR mode is also straightforward: higher bit rates will yield better quality. The "Max Bitrate" setting, also known as "Peak Bitrate" or "Buffer Size", should typically be set to 2 times your target bit rate to help conceal quality loss in scenarios where the complexity of motion in your video quickly goes up and compression ratios have to be increased, but this might also result in a slight bit rate overshoot in some scenarios. Note that VBR will not use all available bit rate if there's no need to - there is also a quality (QP) target, and if that target can be met at a lower bit rate, it will be lower. When using x264, you can see this quality target (as CRF), but other encoders will hide it.
When using x264, you can switch from CRF to CQP for a small performance boost by manually specifying the desired QP value in the "x264 Options" field; for example, qp=20 will switch rate control mode to CQP and use a QP value of 20 (min. 0, max. 51 in Partial range, 63 in Full range)
3. How to calculate bit rates and file sizes for VBR and CBR
Let's say you want to know how many gigabytes per hour will be spent at a given bit rate. Here's how to calculate this:
First, take your total bit rate in kilobits per second (Kbps) and divide it by 8 to get kilobytes per second (KBps):
8000 Kbps / 8 = 1000 KBps
Then, multiply by 3600 seconds:
1000 KBps * 3600 seconds = 3600000 KB per hour
This is 3600 MB per hour, or 3.6 GB per hour. Now we know that recording at 8000 Kbps will result in files that are (at most) 3.6 GB per hour. Please don't forget that audio also has a bit rate and it should be added when doing these calculations, i.e. 8000 Kbps video + 5 audio tracks that are 160 Kbps each = 8800 Kbps.
The same calculations can be done backwards to figure out what bit rate you can record at and for how long, given your free disk space.
Let's say we have 50 GB free and want to record for at least 5 hours. That's 10 GB per hour.
10 GB (gigabytes) per hour = 80 Gb (gigabits) per hour, or 80000 Mb (megabits) per hour.
80000 Mb / 3600 = 22.222 Mbps, or 22222 Kbps. Again, note that audio bit rate must be accounted for.
It should also be noted that VBR can go lower than your target bit rate if it can achieve the target quality at a lower bit rate. CBR will not improve quality in this scenario, it will waste disk space with bit stuffing.
4. Other semi-important settings
A quick look at some other settings that may be worth changing (or why they shouldn't be changed):
- Keyframe interval (in seconds)
Higher values allow for better compression (smaller size and/or higher quality), lower values may improve performance in video players and video editors. A special value of 0 means "default", and the default is 250 frames (~4.1 seconds at 60 FPS, ~8.2 seconds at 30 FPS). Most video streaming platforms require 2 seconds for a compromise between quality and latency, and usually will not benefit from a shorter interval.
- Profile (baseline, main, high)
This is the H.264 profile. Nearly all computers and mobile devices made in the last 10 years should be capable of playing the High profile, so use that.
- GPU (for hardware encoders)
This should stay at 0 unless you have more than one graphics card with the same hardware encoder type.
- Max B-frames
More B-frames isn't always better; fast-paced games tend to get worse results with higher values. Usually not worth changing from the default value of 2.
NVENC only:
- Look-ahead, Psycho Visual Tuning
These will try to improve quality, at the cost of higher GPU usage.
- Profile
NVENC profile. The "Quality" (hq 1-pass) preset should be used nearly all the time. The "Max Quality" (hq pseudo-2-pass) preset uses more than double the resources for a slight quality gain on 1000 series NVIDIA cards or older, and for almost no benefit at all on 1600 series cards and newer. The "low latency" presets should not be used in livestreaming, as they only reduce latency by a few frames, at the cost of significantly worse quality. Here's a good demonstration of low latency vs. normal presets: https://cdn.knightlab.com/libs/juxt...html?uid=a8cb00ac-55c9-11eb-83c8-ebb5d6f907df
x264 only:
- CPU usage preset
OBS Studio uses the "veryfast" preset in Simple output mode, or "ultrafast" if you choose "x264 low CPU usage preset". A slower preset will improve compression, but also use more CPU resources.
- Tune
Tries to account for the type of content, but typically should not be changed.
AMF only:
- Peak Bitrate (VBR only)
This is the same as "Max bitrate" or "Buffer size".
- Quality preset
This should stay on "Balanced", somehow it seems to yield better performance than the "Speed" preset.
- P-frame QP, I-frame QP
AMF allows you to separately specify the QP values for I and P-frames. Using different values for different frame types usually doesn't significantly affect quality.
- View Mode
There's usually no good reason to use any option other than "Basic", as the other options unlock settings that do not yield any useful results. Touching most of the extra settings will reduce quality and/or performance, or introduce stability and compatibility issues.
QSV only:
- Target Usage
Similar to AMF, no reason to use anything other than "balanced".
- QPI, QPP, QPB
QuickSync allows you to separately specify the QP values for I, P and B-frames. Using different values for different frame types usually doesn't significantly affect quality.
- Max Bitrate (VBR only)
This is the same as "Peak Bitrate" or "Buffer size".
- Latency
This should stay on "normal", the other settings will only reduce latency by a few frames, but significantly reduce quality.
Found an error or want to submit other feedback re: this guide? Use the Discussion tab to leave a comment, or write to @Nakajima Megumi#7432 on the obs-studio Discord server if you want a faster response.
Need help? Visit the help channels in the obs-studio Discord server.