This commit is contained in:
手瓜一十雪
2024-11-14 11:35:10 +08:00
parent b463140de7
commit 937c594ff7
3 changed files with 6 additions and 62 deletions

View File

@@ -20,7 +20,7 @@ export async function getVideoInfo(filePath: string, logger: LogWrapper) {
ffmpeg.setFfmpegPath(ffmpegPath);
ffmpeg(filePath).ffprobe((err: any, metadata: ffmpeg.FfprobeData) => {
if (err) {
reject(err);
reject(new Error('无法获取视频信息。'));
} else {
const videoStream = metadata.streams.find((s: FfprobeStream) => s.codec_type === 'video');
if (videoStream) {