feat: server-side video transcoding (AV1 + VVC) with HLS/DASH delivery#13
feat: server-side video transcoding (AV1 + VVC) with HLS/DASH delivery#13Sigma-project wants to merge 145 commits into
Conversation
…dev#16985) * refactor: use TRANSIENT scope to avoid service bucket relay * lint: fix lints * refactor: use transient for apResolver * Update packages/backend/src/core/activitypub/models/ApImageService.ts * fix
…v#17024) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…#16888) * ドライブクリーナーでファイル削除後、リロードなしで画面に反映されるように修正 * CHANGELOG.mdを修正 * CHANGELOGがおかしかったので修正
* enhance(frontend): MkDriveで自動でもっと見るを有効化 * Update Changelog
* add serach service test * add meili test * CIの修正が足りなかった * テストの追加 * fix
* enhance(frontend): ウィジェットの設定画面を改良 * Update Changelog * fix lint
* wip * fix * ref -> reactive * tweak throttle threshold * tweak throttle threshold * rss設定にはmanualSaveを使用するように * Update MkWidgetSettingsDialog.vue --------- Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
* enhance(frontend): ウィジェットの設定項目の多言語対応 * Update Changelog * refactor: move options locale key to root for optimizing artifacts for locale inlining * fix * fix * ✌️ --------- Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
…ndieAuth 11 July 2024 spec (misskey-dev#17030) * enhance(backend): Support client information discovery in the IndieAuth 11 July 2024 spec * add tests * Update Changelog * Update Changelog * fix tests * fix test describe to align with the other describe format
) * enhance(frontend): 「今日誕生日のフォロー中ユーザー」ウィジェットをリファクタリング (cherry picked from commit 24652b9) * fix(backend): 年越しの時期で誕生日検索クエリーが誤動作する問題を修正 (MisskeyIO#577) (cherry picked from commit 3858100) * fix * spdx * delete birthday param on users/following api * 名称を一本化 * Update Changelog * Update Changelog * fix(frontend/WidgetBirthdayFollowings): ユーザーの名前が長いと投稿ボタンがはみ出てしまう問題を修正 (MisskeyIO#582) (cherry picked from commit fa47a54) * use module css * default 3day * Revert "delete birthday param on users/following api" This reverts commit a47456c. * Update Changelog * 日付が1ヶ月ズレている問題を修正? * fix: 日付関連のバグを修正 Co-authored-by: taiy <53635909+taiyme@users.noreply.github.com> * build misskey-js types * add comment * Update CHANGELOG.md * migrate * change migration * UPdate Changelog * fix: revert unnecessary changes * 🎨 * i18n * fix * update changelog * 🎨 * fix lint * refactor: remove unnecessary classes * fix * fix --------- Co-authored-by: まっちゃとーにゅ <17376330+u1-liquid@users.noreply.github.com> Co-authored-by: taiy <53635909+taiyme@users.noreply.github.com>
* fix(frontend): 登録日によるソートの場合はpaginator側のソートを使用するように * Update Changelog * fix lint * refactor
…skey-dev#17058) * refactor(frontend): prefer.model, store.modelではcustomRefを使用するように * fix: watchの解除に失敗してもエラーで落ちないように * Update packages/frontend/src/lib/pizzax.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* fix(frontend): ログインダイアログが表示されたあとの処理がおかしくなる問題を修正 * Update Changelog
…y-dev#17019) * fix(frontend): ファイルタブのセンシティブメディアを開く際に確認ダイアログを出す設定が適用されない問題を修正 * Update Changelog * refactor * Update Changelog
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…key-dev#17059) * fix(frontend): 管理画面でアーカイブ済のお知らせを表示した際にアクティブなお知らせが多い旨の警告が出る問題を修正 * Update Changelog --------- Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
…7023) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* fix(deps): update [frontend] update dependencies * rollback tsgo to fix type error * Revert "rollback tsgo to fix type error" This reverts commit 3a0b94e. * rollback vue-tsc to fix type errors (test) * update vue-tsc to 3.2.0 * update vue-tsc stack to v3.2.1 * rollback vue-tsc to v3.1.8
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
競合を解消: - FileServerService.ts: masterのインライン化版(WasmVips/JXL対応)を採用し、/transcoded配信ルートとtranscodedHandlerを再適用 - backend/package.json: image-size追加 + ioredis 5.9.2維持 - frontend/package.json: @jsquash/jxl追加 + @mcaptcha/core-glue維持(hls.js維持、未使用のvanilla-glueは不採用) - use-uploader.ts: masterの多段JXL圧縮フローを採用 - pnpm-lock.yaml: 解決済みpackage.jsonから再生成 - masterが削除したハンドラ群(FileServerProxyHandler/DriveHandler/FileResolver/Utils)を削除 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Thank you for sending us a great Pull Request! 👍 example: pnpm run build-misskey-js-with-types |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 29d49308b1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| parser: { | ||
| syntax: 'typescript', | ||
| decorators: true, | ||
| dynamicImport: true, | ||
| }, |
There was a problem hiding this comment.
Carry over TSX JSX settings in backend bundle
When pnpm build runs the new backend bundler, the entry point imports the web views under src/server/web/views/*.tsx through ClientServerService. This custom SWC parser config drops the JSX/TSX settings from .swcrc, so those TSX view files cannot be parsed during the production bundle build. Reuse the existing .swcrc JSX parser/transform settings here.
Useful? React with 👍 / 👎.
| // Capability(libsvtav1/HLS)が無ければ投入しない | ||
| this.ffmpegCapabilityService.getCapabilities().then(caps => { | ||
| if (!caps.av1 || !caps.hls) return; | ||
| this.queueService.createVideoTranscodingJob(file.id); |
There was a problem hiding this comment.
Return the enqueue promise so failures are handled
If capability detection succeeds but Bull/Redis rejects createVideoTranscodingJob, this promise is not returned or awaited, so the .catch below does not run. On transient queue failures, the upload completes with no transcoding job and an unhandled rejection instead of the intended warning; return or await this promise from the then callback.
Useful? React with 👍 / 👎.
Summary
アップロード済み動画をサーバー側でバックグラウンドにトランスコードし、AV1 (HLS+DASH) と任意の VVC (DASH のみ) で配信できるようにする。フロントの再生は HLS を優先(Safari はネイティブ、それ以外は
hls.jsを動的 import)。フロントの
mediabunnyによる事前圧縮はサイズ削減目的で残し、サーバー側はストリーミング向けにセグメンテーションを行う、という二段構え。AV1 で入ってきたファイルは-c:v copyで再エンコードを回避する。主な変更
バックエンド
1779779193946-videoTranscoding.jsdrive_file:hlsManifestUrl,dashManifestUrl,transcodingStatus,transcodingPrefix,transcodingVariantsmeta:enableVideoTranscoding,videoTranscodeMaxFileSize,videoTranscodeMaxDuration,keepOriginalAfterTranscodingFFmpegCapabilityService— 起動時にlibsvtav1/libvvenc/libopusを検出。未対応エンコーダはスキップVideoTranscodingService—fluent-ffmpegラッパー。CMAF fMP4 セグメント + HLS master / DASH manifest 生成VideoTranscodingProgressService— Redis Pub/Sub による進捗イベント + ハッシュスナップショットvideoTranscodingとVideoTranscodingProcessorServicedownloading/probing/encoding-av1/encoding-vvc/uploading) に重み付けして全体進捗を算出transcodingStatus = 'failed'へadmin/video-transcoding/{list-jobs, cancel-job, retry-job}videoTranscodingDriveService.addFile後に enqueue / 削除時に S3 上のstream-*/プレフィックス一式をクリーンアップ設定(admin 設定)
keepOriginalAfterTranscoding— false の場合はトランスコード成功直後にオリジナルを削除、urlを HLS master に差し替え(失敗時はオリジナルを保持)フロントエンド
hls.js@1.5.20を追加(動的 import で必要時のみロード)MkMediaVideo.vue—hlsManifestUrlがあれば HLS を優先。Safari はネイティブ、それ以外はhls.js/admin/video-transcodingスコープ外
Test plan
pnpm migrateでマイグレーションが上がる / 下がるffmpeg -codecsにlibsvtav1/libvvencが含まれる環境で起動し、起動ログに Capability が出ることMeta.enableVideoTranscoding = falseのとき従来通りurl直接配信のままで、ジョブが投入されないことenableVideoTranscoding = trueで短い.mp4をアップロード →/admin/video-transcodingに進捗が 0% → 100% で流れ、master.m3u8 / manifest.mpd が生成されることkeepOriginalAfterTranscoding = falseでオリジナルが削除され、DriveFile.urlが HLS master を指すことMeta.videoTranscodeMaxDuration/videoTranscodeMaxFileSizeの上限超過がスキップされることstream-*/配下も削除されることhttps://claude.ai/code/session_017qYaSfU7Mb73zQ64eiStdv