Encoder - AV
Encoder - AV - MistProcAV
This encoder is made by the MistServer team to handle a selection of known/good settings for various codecs to be used for encoding. By only allowing a small selection within the supported Codecs quality and performance can be assured. The main focus of this encoder is adding audio and video tracks as well as providing a JPG track for thumbnails.
This encoder directly integrates with the ffmpeg library allowing a much more efficient and faster pipeline rather than transmuxing twice.
This encoder requires ffmpeg to be installed in order to use and the following compile flag must be set while building Mistserver:
-DWITH_AV=true
codec support
Type | Codecs |
---|---|
Audio | Opus, AAC, PCM |
Video | H264, AV1, JPG, UYVY, YUYV, NV12 |
Default settings that always apply
- Bframes will always be removed from outputs
- Framerate will always be copied from the source
- MistProcAV creates an audio or video pipeline per process
- Sync is guaranteed between source and added tracks
Configuration
MistProcAV is best configured through the interface, it can be started manually by passing JSON to MistProcAV or it can be saved directly into the configuration. When not using the interface we recommend running MistProcAV -j
to see all the available options and how to set them.
Interface
MistProcAV has different settings for audio and video. The interface makes the selection easier.
video
audio
Configuration file / API
The following would be setting up an H264/Opus encode using the defaults.
"processes": [
{
"bitrate": 8000000,
"codec": "H264",
"exit_unmask": false,
"gopsize": 120,
"inconsequential": false,
"process": "AV",
"tags_inhibit": [],
"tune": "zerolatency-lq",
"x-LSP-kind": "video"
},
{
"bitrate": 192000,
"codec": "opus",
"exit_unmask": false,
"inconsequential": false,
"process": "AV",
"tags_inhibit": [],
"x-LSP-kind": "audio"
}
]
Command line
In order for MistProcAV to run command line you need to make sure you're also setting a source
.
Example: Setting an opus encode for the stream example
.
MistProcAV '{"bitrate":110000,"codec":"opus","exit_unmask":0,"inconsequential":false,"process":"AV","source":"example","x-LSP-kind": "audio"}'
Required options
You need to set the codec wanted for the end result. This is done through "codec":"SELECT_OPTION"
. The codec determines whether audio or video is used.
Anything between ()
should not get passed, it is a comment for readability
Key | Name | Type | Help / Description | Select Options | Default / Value |
---|---|---|---|---|---|
process | process selector | select | Selects the specific process | AV | |
x-LSP-kind | Input type | select | Type of input to use | Video, Audio | video |
codec (video) | Target codec | select | Which codec to encode to | AV1, H264, JPEG, UYVY | H264 |
codec (audio) | Target codec | select | Which codec to encode to | AAC, Opus, PCM | opus |
Optional options
Anything between ()
should not get passed, it is a comment for readability
Key | Name | Type | Default / Value | Unit | Help / Description | Options (if applicable) |
---|---|---|---|---|---|---|
accel | Hardware acceleration | select | Automatic: attempt acceleration, fallback to software | — | Control whether hardware acceleration is used or not | hw (Force enabled), sw (Software-only) |
bitrate (video) | Bitrate | uint | 8,000,000 (8 mbps) | bit/s, kbit/s, Mbit/s, Gbit/s | Target bitrate for video; not used with JPEG or UYVY | — |
bitrate (audio) | Bitrate | uint | 192,000 (192 kbps) | bit/s, kbit/s | Target bitrate for audio; not used with PCM | — |
crf | Constant Rate Factor (software only) | int | 23 | — | Software encoding quality (1–51, lower = better). Used for H264 only. | — |
gopsize (video) | GOP Size | uint | 120 | — | Frames before new keyframe (except JPEG/UYVY) | — |
gopsize (JPEG) | GOP Size | uint | 120 | — | Minimum frames between images (JPEG) | — |
preset | Encode preset | select | faster | — | Encoding speed vs compression ratio (H264 only) | ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow |
profile (H264) | Encode profile | select | high | — | Select encoding profile | main, baseline, high |
profile (AAC) | Encode profile | select | low | — | Select encoding profile | low, main, he |
quality | Quality | int | 20 | — | JPEG-only compression quality (1–31, lower = better) | — |
resolution | Resolution | str | keep source resolution | — | Output stream resolution (e.g., 1920x1080) | — |
sample_rate (AAC) | Sample rate | uint | — | Hz, kHz | Output sample rate; copies input if possible | — |
sample_rate (PCM) | Sample rate | uint | 48000 | Hz, kHz | Output sample rate for PCM audio | — |
tune | Encode tuning | select | zerolatency-lq | — | H264 tuning for performance/quality | zerolatency, zerolatency-lq, zerolatency-hq, animation, film |
General process options
Key | Name | Type | Default / Value | Unit | Help / Description | Options (if applicable) |
---|---|---|---|---|---|---|
debug | Debug level | debug | — | — | Debug message level for process | — |
exit_unmask | Undo masks on process exit/fail | boolean | false | — | Resets input track masks to defaults on exit/fail | — |
sink | Target stream | string | — | — | Which stream the encoded track should be added to | — |
source | Source stream | string | — | — | Which stream the encoded track should pull from, defaults to the stream the process is added towards | — |
source_mask | Source track mask | select | Keep original value | — | Access permissions for source tracks | Everything, Processing, Processing+Pushing, Processing+Viewing |
target_mask | Output track mask | select | Keep original value | — | Access permissions for output tracks | Viewer, Pushing, Processing, combinations thereof |
track_select | Source selector(s) | string | audio=all&video=all | — | Which tracks to select for input | — |
start_control | Process start behaviour | group | — | — | Controls when and how process starts | see below |
start control options
Subkey | Name | Type | Default | Unit | Help / Description | Options (if applicable) |
---|---|---|---|---|---|---|
inconsequential | Inconsequential process | bool | false | — | Process not required for stream to be considered active | — |
restart_delay | Restart delay | uint | 0 | ms | Delay between restarts | — |
restart_type | Restart behaviour | select | fixed | — | What to do when the process exits/fails | fixed, backoff, disabled |
tags_inhibit | Tag inhibitor(s) | inputlist | "" | — | List of tags preventing process start | — |
track_inhibit | Track inhibitor(s) | string | audio=none&video=none&subtitle=none | — | Which tracks inhibit process start | — |