Codec Settings
This guide provides detailed instructions and insights into configuring codecs for Streampixel to ensure optimal streaming performance under various conditions.
Overview
A codec, which stands for "compressor-decompressor", is critical in streaming for encoding video and audio data on the server side (compression) and decoding it on the client side (decompression). The choice of codec affects not only the stream quality and bandwidth usage but also compatibility with viewer devices.
Default Codec Configuration
By default, StreamPixel has selected the most efficient codecs for optimal performance. However, depending on your specific use case and the version of Unreal Engine you are using, it might sometimes be beneficial to adjust these settings:
Default Settings:
AV1
as the primary codec withH.264
as the fallback to ensure maximum compatibility and efficiency.Customization Advice: Based on your audience’s device capabilities and network conditions, you may find it advantageous to select different primary or fallback codecs.
Codec Options
Streampixel supports several codecs, each with distinct attributes suitable for different streaming requirements:
H.264
: Offers broad compatibility and fast processing, ideal for almost all devices and browsers, though it may result in blockier images at lower bitrates.VP8
: Improves image quality at lower bitrates than H.264 but with less widespread device support.VP9
: Provides the highest image quality at the lowest bitrates but may cause issues with WebRTC frame rates, despite excellent internal frame performance.AV1
: The most advanced codec, offering the best compression efficiency, which is perfect for reducing bandwidth without sacrificing quality, requiring modern hardware for decoding.
Codec Performance Overview
AV1
GPU
~8.98ms/15.8ms
Has the highest image quality at the lowest bitrates, compared to other encoders.
Best
VP9
CPU
~15ms/50ms
Has highest image quality at lowest bitrates
Good
VP8
CPU
~10.5ms/25ms
Produces a better image quality at lower bitrate
Average
H.264
GPU
~8.97ms/24.17ms
Fast encoding/decoding, widely supported
Blocky
Source: Unreal Engine Documentation
Selecting Primary and Fallback Codecs
Primary Codec Considerations
Choose a primary codec based on the balance between quality and bandwidth efficiency, considering the general hardware capabilities of your audience.
AV1 is supported for Unreal Engine versions 5.4 and above. If your Unreal Engine version is below 5.4 and you have selected AV1
as your primary codec, it will automatically fallback to the designated fallback codec.
Fallback Codec Usage
The fallback codec ensures stream accessibility if the primary codec fails due to compatibility issues:
Recommended Setup: Consider
VP9
for enhanced efficiency as a fallback if your audience primarily uses newer devices. Otherwise, maintainH.264
for its universal support, especially in mixed-device environments.
VP9
can deliver high-quality video at low bitrates but may lead to dropped WebRTC frame rates. Test this codec for your app and if issues arise, consider using H.264
for better stability and wider compatibility.
Examples of Fallback Codec Activation:
Device Compatibility: If
AV1
is set as the primary codec and a viewer is using an iPhone, which does not supportAV1
decoding, the system will automatically switch to the fallback codec. This ensures that the stream remains viewable without interruption.Browser Support: Certain versions of Firefox do not support
AV1
. In such cases, if AV1 is the primary codec, the system will fallback to a compatible codec, such asVP9
orH.264
, depending on your settings.
These examples illustrate common situations where the fallback codec ensures continuous service delivery, underscoring the importance of selecting a widely supported fallback codec.
Customizing Codec Settings
Access Codec Settings: Navigate to your Streampixel project’s settings panel.
Configure Codecs: Adjust the primary and fallback codecs based on testing results and user feedback to optimize for quality and performance.
Troubleshooting and Optimization
Monitor stream performance and user feedback actively to adapt codec settings, ensuring the best possible experience across all devices and network conditions.
Last updated