feat: introduce Xtream Codes API service for IPTV content access and streaming.

This commit is contained in:
Michael committed 2025-12-14 21:48:37 +01:00
1 parent 66a020416e
commit b0de7bce86
4 files changed
+39 -29

No files matched your search

+11 -9
View File
@@ -152,18 +152,20 @@ Handler createStreamInitHandler() {
final isLiveStream = iptvUrl.endsWith('.ts') || iptvUrl.contains('/live/');
if (isLiveStream) {
// LIVE TV: Fast transcoding with ultrafast preset
// LIVE TV: Transcode to H.264 for browser compatibility
// Source may be HEVC/H.265 which browsers don't support
// Using superfast preset for minimal CPU usage
ffmpegArgs.addAll([
'-c:v', 'libx264',
'-preset', 'ultrafast',
'-tune', 'zerolatency',
'-profile:v', 'main', // Main profile for better quality than baseline
'-level', '4.0',
'-preset', 'superfast', // Fast encoding to prevent buffering
'-tune', 'zerolatency', // Minimize latency
'-profile:v', 'baseline', // Maximum browser compatibility
'-level', '3.1',
'-pix_fmt', 'yuv420p',
'-g', '48', // 2s GOP at 24fps
'-b:v', '4000k', // 4Mbps for good quality live
'-maxrate', '4500k',
'-bufsize', '8000k',
'-g', '30', // Keyframe every second at 30fps
'-b:v', '2500k', // 2.5Mbps - balance quality/speed
'-maxrate', '3000k',
'-bufsize', '5000k',
]);
} else {
// VOD: Higher quality transcoding