Einstellungen und Zusatzdateien für den Schnitt ablegen
Intro, Outro, Backing Track und Voice-overs pro Clip laufen über denselben Upload in Stücken wie die Clips. Die Schnitt-Einstellungen werden feldweise geprüft; ffprobe akzeptiert jetzt auch reine Tonspuren. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
d7102d04a4
commit
72e4b8ab7a
6 files changed
+340
-45
No files matched your search
+11
-4
@@ -16,7 +16,8 @@ function readRotation(stream) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Liefert die Eckdaten eines Videos, Breite und Höhe so, wie es angezeigt wird.
|
||||
// Liefert die Eckdaten einer Video- oder Audiodatei; Breite und Höhe so,
|
||||
// wie das Video angezeigt wird.
|
||||
export async function probe(file) {
|
||||
const { stdout } = await execFileAsync(
|
||||
'ffprobe',
|
||||
@@ -27,16 +28,22 @@ export async function probe(file) {
|
||||
const video = info.streams.find(
|
||||
(stream) => stream.codec_type === 'video' && !stream.disposition?.attached_pic,
|
||||
);
|
||||
if (!video) throw new Error('Keine Videospur gefunden.');
|
||||
const hasAudio = info.streams.some((stream) => stream.codec_type === 'audio');
|
||||
if (!video && !hasAudio) throw new Error('Weder Bild noch Ton gefunden.');
|
||||
|
||||
const duration = Number(info.format?.duration ?? video?.duration ?? 0);
|
||||
if (!video) {
|
||||
return { duration, hasVideo: false, width: null, height: null, rotation: 0, fps: 0, hasAudio };
|
||||
}
|
||||
const rotation = readRotation(video);
|
||||
const sideways = Math.abs(rotation) % 180 === 90;
|
||||
return {
|
||||
duration: Number(info.format?.duration ?? video.duration ?? 0),
|
||||
duration,
|
||||
hasVideo: true,
|
||||
width: sideways ? video.height : video.width,
|
||||
height: sideways ? video.width : video.height,
|
||||
rotation,
|
||||
fps: Math.round(parseRate(video.avg_frame_rate || video.r_frame_rate) * 100) / 100,
|
||||
hasAudio: info.streams.some((stream) => stream.codec_type === 'audio'),
|
||||
hasAudio,
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user