From b449ef0ce3e7042335d2a8f1433c65f84474e135 Mon Sep 17 00:00:00 2001 From: zgaetano Date: Fri, 29 May 2026 21:21:44 -0400 Subject: [PATCH] fix(worker): YouTube importer prefers H.264 so originals import in Premiere YouTube now packs AV1 inside .mp4, so the old `bv*[ext=mp4]` format selector grabbed AV1 for the downloaded ORIGINAL. Premiere rejects AV1 on hi-res import ("unsupported file type"). The h264 proxy was fine, but the original wasn't. Prefer avc1 (H.264) so the original is Premiere-native, falling back to the previous any-mp4 behaviour only when no H.264 rendition exists. avc1 tops out at 1080p on YouTube (above that is AV1/VP9 only), which is the universally importable ceiling anyway. Verified on a real URL: old selector -> av01 1080p; new selector -> avc1 1080p (same resolution, now Premiere-native). Co-Authored-By: Claude Opus 4.8 --- services/worker/src/workers/youtube-import.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/services/worker/src/workers/youtube-import.js b/services/worker/src/workers/youtube-import.js index f2765a5..b25356c 100644 --- a/services/worker/src/workers/youtube-import.js +++ b/services/worker/src/workers/youtube-import.js @@ -67,7 +67,12 @@ async function runYtDlp({ url, outputTemplate, onProgress }) { '--no-playlist', '--no-warnings', '--restrict-filenames', - '-f', "bv*[ext=mp4]+ba[ext=m4a]/b[ext=mp4]/b", + // Prefer H.264 (avc1) so the downloaded ORIGINAL is Premiere-native. + // YouTube now packs AV1 inside .mp4, so the old `bv*[ext=mp4]` selector + // grabbed AV1 — which Premiere rejects on hi-res import ("unsupported + // file type"). avc1 tops out at 1080p on YouTube; only if no H.264 + // rendition exists do we fall back to the previous any-mp4 behaviour. + '-f', "bv*[vcodec^=avc1]+ba[ext=m4a]/bv*[vcodec^=avc1]+ba/b[vcodec^=avc1]/bv*[ext=mp4]+ba[ext=m4a]/b[ext=mp4]/b", '--merge-output-format', 'mp4', '--print-json', '--newline',