mirror of
https://github.com/imputnet/cobalt.git
synced 2025-06-28 01:18:27 +00:00
web/workers/ffmpeg: proper error code for missing audio channel error
Some checks are pending
Some checks are pending
This commit is contained in:
parent
5ea170a5ac
commit
507fab847b
@ -15,5 +15,6 @@
|
||||
"ffmpeg.no_input_type": "the file's type isn't supported",
|
||||
"ffmpeg.crashed": "ffmpeg worker crashed, see console for details",
|
||||
"ffmpeg.no_render": "ffmpeg render is empty, something very odd happened",
|
||||
"ffmpeg.no_args": "ffmpeg worker didn't get required arguments"
|
||||
"ffmpeg.no_args": "ffmpeg worker didn't get required arguments",
|
||||
"ffmpeg.no_audio_channel": "this video has no audio track, nothing to do"
|
||||
}
|
||||
|
@ -64,6 +64,14 @@ const ffmpeg = async (variant: string, files: File[], args: string[], output: Fi
|
||||
return error("queue.ffmpeg.no_input_format");
|
||||
}
|
||||
|
||||
// handle the edge case when a video doesn't have an audio track
|
||||
// but user still tries to extract it
|
||||
if (files.length === 1 && file_info.streams?.length === 1) {
|
||||
if (output.type?.startsWith("audio") && file_info.streams[0].codec_type !== "audio") {
|
||||
return error("queue.ffmpeg.no_audio_channel");
|
||||
}
|
||||
}
|
||||
|
||||
self.postMessage({
|
||||
cobaltFFmpegWorker: {
|
||||
progress: {
|
||||
|
Loading…
Reference in New Issue
Block a user