Updated transcoding to support surround sound

This commit is contained in:
Trevor Mears
2025-12-29 22:55:09 -08:00
parent f8d625e9fe
commit 3b14a17bfb
2 changed files with 3 additions and 4 deletions
+2 -2
View File
@@ -302,7 +302,7 @@ class VideoPlayer {
// Buffer stalled - seek forward to unstick // Buffer stalled - seek forward to unstick
console.log('[HLS] Buffer stalled, seeking to recover...'); console.log('[HLS] Buffer stalled, seeking to recover...');
if (!this.video.paused && this.video.currentTime > 0) { if (!this.video.paused && this.video.currentTime > 0) {
this.video.currentTime += 0.5; this.video.currentTime += 1;
} }
} }
} }
@@ -323,7 +323,7 @@ class VideoPlayer {
if (!wasFirstDetection && !this.video.paused && this.video.currentTime > 0) { if (!wasFirstDetection && !this.video.paused && this.video.currentTime > 0) {
// Seek forward slightly to skip past any corrupted audio frames // Seek forward slightly to skip past any corrupted audio frames
console.log('[HLS] Seeking past discontinuity boundary'); console.log('[HLS] Seeking past discontinuity boundary');
this.video.currentTime += 0.5; this.video.currentTime += 1;
} }
} }
} }
+1 -2
View File
@@ -31,9 +31,8 @@ router.get('/', (req, res) => {
'-c:v', 'copy', '-c:v', 'copy',
// Audio: Transcode to browser-compatible AAC with consistent parameters // Audio: Transcode to browser-compatible AAC with consistent parameters
'-c:a', 'aac', '-c:a', 'aac',
'-ac', '2',
'-ar', '48000', '-ar', '48000',
'-b:a', '128k', '-b:a', '256k', // Increased for surround sound
'-af', 'aresample=48000:async=1', '-af', 'aresample=48000:async=1',
// Fragmented MP4 for streaming (browser-compatible) // Fragmented MP4 for streaming (browser-compatible)
'-f', 'mp4', '-f', 'mp4',