-
Notifications
You must be signed in to change notification settings - Fork 0
Encoding
MSP v0.9.0+ introduces Hardware-Accelerated Transcoding support, leveraging GPU encoders to significantly improve transcoding speed and reduce CPU usage. See Hardware Acceleration for details.
MSP uses a practical "probe-aware direct play first" strategy:
-
Try-First (Direct Play):
- MSP first attempts raw direct streaming.
- Benefit: when direct play works, server CPU usage stays near zero.
-
Probe-Aware Preemptive Transcode:
- Containers with known poor browser support (
AVI/WMV) are transcoded preemptively. - Other formats still go through direct play first, then fallback to transcode only on real failure.
- Native WMV stream keeps explicit MIME:
video/x-ms-wmv.
- Containers with known poor browser support (
-
Fallback-Next (Auto Transcode):
- On direct-play failure, MSP performs one same-origin retry with a refreshed
ts. - If it still fails and transcoding is enabled, MSP falls back to real-time transcoding.
- On direct-play failure, MSP performs one same-origin retry with a refreshed
When Direct Play fails, MSP uses ffmpeg on the server to transcode media on the fly.
- The server must have FFmpeg installed.
- The
ffmpegcommand must be available in the system PATH.
- Video: Automatically converts to H.264/AAC MP4 stream.
- Audio: Automatically converts to MP3 stream.
-
Seeking: Supported (Smart Seeking).
- MSP v0.8.4+ supports seeking within transcoded streams. The server regenerates the stream from the new timestamp.
For best compatibility, it is highly recommended to enable transcoding in config.json:
{
"playback": {
"video": { "transcode": true },
"audio": { "transcode": true }
}
}Note: Enabling this does NOT mean all videos will be transcoded. Common MP4 (H.264/AAC) stays on direct play unless the container is high-risk or playback truly fails.
It depends on the codec inside. H.264 inside MKV usually Direct Plays. HEVC inside MKV (if unsupported by browser) triggers transcoding.
Real-time video transcoding is CPU-intensive. MSP limits concurrent transcoding sessions (default: 2) to prevent server overload.
Most modern browsers (Chrome, Edge, Firefox, Safari) natively support:
-
Video Codecs:
- H.264 (AVC): Best compatibility.
- VP8 / VP9: Good compatibility.
- H.265 (HEVC): Poor browser support. Often requires hardware support + OS extensions.
-
Audio Codecs:
- AAC: Best compatibility.
- MP3: Good compatibility.
- Opus / Vorbis: Good compatibility.
- AC-3 (Dolby): Generally unsupported in browsers.