|
|
@@ -86,18 +86,18 @@ function transcodeToHLS(videoPath, outputDir, assetId, duration) {
|
|
|
let lastPct = 0;
|
|
|
|
|
|
ffmpeg(videoPath)
|
|
|
- // ── Re-encode to H.264 + AAC (universal browser support) ─────────────
|
|
|
+ // ── Re-encode to H.264 + AAC ────────────────────────────────────────
|
|
|
.outputOptions([
|
|
|
- '-c:v libx264', // H.264 — every browser supports via MSE
|
|
|
- '-c:a aac', // AAC — universal audio codec
|
|
|
- '-movflags +faststart', // moov atom at front → fast playback start
|
|
|
+ '-c:v libx264',
|
|
|
+ '-c:a aac',
|
|
|
+ '-movflags +faststart',
|
|
|
'-preset fast',
|
|
|
'-crf 23',
|
|
|
- // HLS output
|
|
|
'-f hls',
|
|
|
- '-hls_time 6',
|
|
|
+ '-hls_time 2',
|
|
|
'-hls_playlist_type vod',
|
|
|
'-hls_segment_filename', segmentPattern,
|
|
|
+ '-hls_list_size 0',
|
|
|
])
|
|
|
.output(playlistPath)
|
|
|
.on('progress', ({ percent }) => {
|