Overview
FFmpeg profiles define transcoding settings for channel streams, including video/audio codecs, bitrates, resolution, hardware acceleration, and more. Each channel is assigned an FFmpeg profile that controls how media is processed for streaming.Get All FFmpeg Profiles
Retrieve a list of all FFmpeg profiles.Response
Array of FFmpeg profile objects
Example Request
Example Response
Create FFmpeg Profile
Create a new FFmpeg profile with transcoding settings.Request Body
All fields from the FFmpeg profile object are required except hardware-specific fields.Hardware acceleration fields (
vaapiDisplay, vaapiDriver, vaapiDevice, qsvExtraHardwareFrames) are only required when using the corresponding hardwareAcceleration type.Example Request
Example Response
Update FFmpeg Profile
Update an existing FFmpeg profile.Request Body
Same as create, but must include the profilefFmpegProfileId:
ID of the profile to update
Example Request
Delete FFmpeg Profile
Delete an FFmpeg profile.Path Parameters
ID of the profile to delete
Response
200 OK- Profile deleted successfully409 Conflict- Profile is in use by a channel
Example Request
Get Resolution by Name
Retrieve resolution details by name for use in profile creation.Path Parameters
Resolution name (e.g., “1920x1080”, “1280x720”)
Response
Resolution ID for use in profile creation
Resolution name
Horizontal resolution in pixels
Vertical resolution in pixels
Whether this is a custom resolution
Example Request
Example Response
Hardware Acceleration
ErsatzTV supports multiple hardware acceleration platforms:Intel QSV
Quick Sync Video for Intel CPUs with integrated graphics
NVIDIA NVENC
Hardware encoding on NVIDIA GPUs
VA-API
Video Acceleration API for Intel and AMD GPUs
Apple VideoToolbox
Hardware acceleration on macOS and iOS
AMD AMF
Advanced Media Framework for AMD GPUs
Video4Linux2
Hardware encoding on embedded Linux devices
Hardware Acceleration Setup
Hardware acceleration requires proper drivers and device access. See Hardware Acceleration Guide for setup instructions.
VA-API Configuration
For VA-API acceleration:- Display:
/dev/dri/renderD128(or your device path) - Driver: Select based on your GPU
iHD- Modern Intel GPUsi965- Older Intel GPUsRadeonSI- AMD GPUs
- Device: Usually same as display
QSV Configuration
- Set
qsvExtraHardwareFramesto 64 or higher for complex content - Requires Intel CPU with integrated graphics
- Best performance with recent Intel generations
Video Codecs
H.264 (AVC)
- Most compatible codec
- Wide device support
- Profiles:
baseline,main,high - Recommended for general use
H.265 (HEVC)
- Better compression than H.264
- Lower bitrate for same quality
- Requires newer devices/players
- Profiles:
main,main10
MPEG-2
- Legacy codec for compatibility
- Larger file sizes
- Universal support
- Use for older devices
AV1
- Next-generation codec
- Best compression efficiency
- Limited hardware support
- CPU-intensive encoding
Copy Mode
- No transcoding
- Source stream copied directly
- Fastest, lowest CPU usage
- Requires compatible source
Audio Codecs
AAC
- Standard for modern streaming
- Good quality at low bitrates
- Wide device support
- Recommended: 192 kbps for stereo
AC-3 (Dolby Digital)
- Supports multichannel audio
- Compatible with most devices
- Higher bitrates than AAC
- Recommended: 384 kbps for 5.1
AAC LATM
- AAC variant for MPEG-TS streams
- Use for IPTV/broadcast applications
Copy Mode
- No audio transcoding
- Preserves original audio
- Requires compatible source and client
Bitrate Guidelines
Video Bitrates
| Resolution | H.264 | H.265 | Use Case |
|---|---|---|---|
| 1920x1080 | 8-12 Mbps | 6-9 Mbps | Full HD |
| 1280x720 | 4-6 Mbps | 3-5 Mbps | HD |
| 854x480 | 2-3 Mbps | 1.5-2.5 Mbps | SD |
| 640x480 | 1-2 Mbps | 0.8-1.5 Mbps | Low quality |
Audio Bitrates
| Configuration | Bitrate | Use Case |
|---|---|---|
| Stereo (2.0) | 128-192 kbps | Standard quality |
| Stereo (2.0) | 256 kbps | High quality |
| 5.1 Surround | 384-448 kbps | Home theater |
| Mono | 64-96 kbps | Voice/podcast |
Buffer size should typically be 2x the target bitrate for smooth streaming.
Best Practices
Test Profiles
Test new profiles with sample content before production use
Match Source
Target resolution and bitrate appropriate for your source content
Hardware First
Use hardware acceleration when available for better performance
Profile Per Use
Create different profiles for different quality tiers or device types
Troubleshooting
Transcoding Errors
If streams fail to start:- Check FFmpeg logs for errors
- Verify hardware acceleration is properly configured
- Test with software encoding (
hardwareAcceleration: "None") - Ensure FFmpeg has required codecs
Poor Quality
If stream quality is poor:- Increase
videoBitrateandvideoBufferSize - Use a slower
videoPreset(e.g., “slow” instead of “fast”) - Consider higher resolution
- Check source quality
High CPU Usage
If CPU usage is too high:- Enable hardware acceleration
- Reduce resolution or bitrate
- Use faster
videoPreset - Increase
threadCount - Consider using H.264 instead of H.265/AV1
Related Endpoints
- Channels API - Assign profiles to channels
- Sessions API - Monitor active transcoding sessions
Next Steps
Hardware Acceleration
Configure GPU-accelerated transcoding
Transcoding Guide
Learn about transcoding concepts and optimization
