Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/lib/server/providers/ytdlp/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,17 @@ export class YtDlpProvider implements DownloadProvider {

const args = [
'--no-playlist',
// Prefer the best sub-1080p video+audio and merge; fall back to a muxed format, then
// anything. Sites like Instagram now serve split DASH streams that a bare `best`
// (muxed-only) selector can miss, so select streams explicitly and let FFmpeg merge.
// Prefer a browser-safe MUXED H.264 stream (playable in Safari/iOS), falling back to
// a DASH merge only when no muxed format exists. This matters because Instagram serves
// H.264 only as the muxed/progressive format while its video-only DASH is VP9, and
// YouTube's is AV1 — neither VP9 nor AV1 plays on iOS. The `-S` sort then biases every
// tier toward h264/aac so a merge fallback still picks compatible codecs when possible.
'-f',
'bv*[height<=1080]+ba/b[height<=1080]/b',
'best[height<=1080]/best/bv*[height<=1080]+ba/bv*+ba',
'-S',
'vcodec:h264,acodec:aac,res:1080',
'--merge-output-format',
'mp4',
'--write-thumbnail',
'--convert-thumbnails',
'jpg',
Expand Down
Loading