Fix video audio loss during compression by preserving audio stream (#16696)

* Initial plan

* Fix video audio loss during compression by specifying AAC codec

Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>

* Fix audio by avoiding transcoding - copy audio stream directly

Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
This commit is contained in:
Copilot 2025-10-23 18:59:12 +09:00 committed by GitHub
parent 2e07e50bb4
commit 42f230f223
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -634,7 +634,9 @@ export function useUploader(options: {
bitrate: item.compressionLevel === 1 ? mediabunny.QUALITY_VERY_HIGH : item.compressionLevel === 2 ? mediabunny.QUALITY_MEDIUM : mediabunny.QUALITY_VERY_LOW,
},
audio: {
bitrate: item.compressionLevel === 1 ? mediabunny.QUALITY_VERY_HIGH : item.compressionLevel === 2 ? mediabunny.QUALITY_MEDIUM : mediabunny.QUALITY_VERY_LOW,
// Explicitly keep audio (don't discard) and copy it if possible
// without re-encoding to avoid WebCodecs limitations on iOS Safari
discard: false,
},
});