
Ich versuche, mehrere Videos zu einem einzigen Video zusammenzufügen. Wie Sie unten in der Ausgabe von ffprobe
vier Beispielvideos sehen können, unterscheiden sie sich alle in einigen Punkten.
Idealerweise würde ich jedes gerne auf eine bestimmte Größe normalisieren – sagen wir 1280 x 720 – und sie dann verketten.
Ich habe Variationen von etwa Folgendem ausprobiert:
ffmpeg -hide_banner -loglevel error -i ./tmp/1.mp4 -i ./tmp/2.mp4 -i ./tmp/3.mp4 -i ./tmp/4.mp4
-filter_complex "[0:v]scale=1280:720:force_original_aspect_ratio=1,pad=1280:720:(ow-iw)/2:(oh-ih)/2,setsar=1[var0];
[1:v]scale=1280:720:force_original_aspect_ratio=1,pad=1280:720:(ow-iw)/2:(oh-ih)/2,setsar=1[var1];
[2:v]scale=1280:720:force_original_aspect_ratio=1,pad=1280:720:(ow-iw)/2:(oh-ih)/2,setsar=1[var2];
[3:v]scale=1280:720:force_original_aspect_ratio=1,pad=1280:720:(ow-iw)/2:(oh-ih)/2,setsar=1[var3];[var0][0:a:0][var1][1:a:0][var2][2:a:0][var3][3:a:0]concat=n=4:v=1:a=1[v][a]"
-map [v] -map [a] ./tmp/output.mp4
Dies führt nicht zu einem Fehler, sondern erstellt eine Datei, die scheinbar nie aufhört zu wachsen.
Ich bin ziemlich neu bei ffmpeg, aber ich habe das jetzt schon eine Weile erforscht, aber ohne Erfolg. Für jede Hilfe wäre ich dankbar!
Nachfolgend finden Sie die Details zu jeder Datei.
1.mp4
Input #0, matroska,webm, from '1.mp4':
Metadata:
encoder : Chrome
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0(eng): Audio: opus, 48000 Hz, mono, fltp (default)
Stream #0:1(eng): Video: vp9 (Profile 0), yuv420p(tv), 1620x910, SAR 1:1 DAR 162:91, 24.83 fps, 24.83 tbr, 1k tbn (default)
Metadata:
alpha_mode : 1
2.mp4
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '2.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2mp41
encoder : Lavf59.27.100
Duration: 00:00:09.05, start: 0.000000, bitrate: 793 kb/s
Stream #0:0[0x1](und): Audio: mp3 (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 64 kb/s (default)
Metadata:
handler_name : SoundHandler
vendor_id : [0][0][0][0]
Stream #0:1[0x2](und): Video: mjpeg (Progressive) (mp4v / 0x7634706D), yuvj420p(pc, bt470bg/unknown/unknown), 4963x3062 [SAR 72:72 DAR 4963:3062], 164635 kb/s, 25 fps, 25 tbr, 12800 tbn (default)
Metadata:
handler_name : VideoHandler
vendor_id : [0][0][0][0]
3.mp4
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '3.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2mp41
encoder : Lavf59.27.100
Duration: 00:00:10.20, start: 0.000000, bitrate: 957 kb/s
Stream #0:0[0x1](eng): Audio: opus (Opus / 0x7375704F), 48000 Hz, mono, fltp, 50 kb/s (default)
Metadata:
handler_name : SoundHandler
vendor_id : [0][0][0][0]
Stream #0:1[0x2](und): Video: png (mp4v / 0x7634706D), rgb24(pc), 2667x1500 [SAR 7874:7874 DAR 889:500], 230945 kb/s, 25 fps, 25 tbr, 12800 tbn (default)
Metadata:
handler_name : VideoHandler
vendor_id : [0][0][0][0]
4.mp4
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '4.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Duration: 00:02:12.08, start: 0.000000, bitrate: 311 kb/s
Stream #0:0[0x1](und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 566x720 [SAR 1:1 DAR 283:360], 174 kb/s, 30 fps, 30 tbr, 15360 tbn (default)
Metadata:
handler_name : ISO Media file produced by Google Inc.
vendor_id : [0][0][0][0]
Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 127 kb/s (default)
Metadata:
handler_name : ISO Media file produced by Google Inc.
vendor_id : [0][0][0][0]