mgolbs schrieb:
Hallo,
ich würde gern zwei typgleiche *.ogv Videos nebeneinander in eines konvertieren, gleiche Höhe und doppelte Breite vom Format.
Hallo mgolbs,
die folgende Lösung habe ich mal getestet:
Überprüfe die Qualität der beiden Ausgangsvideodateien
$ mediainfo input-* | egrep 'Complete name|Format|Overall bit rate|Width|Height'
Complete name : input-left.ogg
Format : OGG
Overall bit rate mode : Variable
Overall bit rate : 2 602 Kbps
Format : Theora
Width : 1 280 pixels
Height : 720 pixels
Format : Vorbis
Format settings, Floor : 1
Complete name : input-right.ogg
Format : OGG
Overall bit rate mode : Variable
Overall bit rate : 2 602 Kbps
Format : Theora
Width : 1 280 pixels
Height : 720 pixels
Format : Vorbis
Format settings, Floor : 1
$
, wobei "Format", "Width", "Height" und der höhere Wert - falls dieser bei den beiden Videos nicht gleich ist - für "Bit rate" berücksichtigt werden müssen.
Positioniere beide Videos nebeneinander mit
ffmpeg -i input-left.ogg -i input-right.ogg -an -filter_complex hstack -b:v 2700k output_2x-breit_1x-hoch.ogg
,
wobei folgende Parameter angewandt werden
Audio options:
-an disable audio
Advanced global options:
-filter_complex graph_description create a complex filtergraph
Video options:
-b bitrate video bitrate (please use -b:v)
.
Als Ergebnis siehst Du
$ mediainfo output_2x-breit_1x-hoch.ogg | egrep 'Complete name|Format|Bit rate|Width|Height'
Complete name : output_2x-breit_1x-hoch.ogg
Format : OGG
Format : Theora
Bit rate : 2 700 Kbps
Width : 2 560 pixels
Height : 720 pixels
$
Konvertiere diese Ausgabedatei ggf. in eine 16:9-Datei mit schwarzen Balken mit
ffmpeg -i output_2x-breit_1x-hoch.ogg -vf scale=1920:1080,crop=1920:1080:0:270 -b:v 2700k output_FULL-HD.ogg
Die neuen Abmessungen für "output_2x-breit_1x-hoch.ogg" ergeben 1920 x 540 und die schwarzen Balken sind jeweils 270 Pixel hoch.
Parameter aus 'man ffmpeg':
As an output option, this inserts the "scale" video filter to the end of the corresponding filtergraph. Please use
the "scale" filter directly to insert it at the beginning or some other place.
The format is wxh (default - same as source).
Parameter aus 'ffmpeg -h long':
crop AVOptions:
out_w <string> ..FV.... set the width crop area expression (default "iw")
w <string> ..FV.... set the width crop area expression (default "iw")
out_h <string> ..FV.... set the height crop area expression (default "ih")
h <string> ..FV.... set the height crop area expression (default "ih")
x <string> ..FV.... set the x crop area expression (default "(in_w-out_w)/2")
y <string> ..FV.... set the y crop area expression (default "(in_h-out_h)/2")
keep_aspect <boolean> ..FV.... keep aspect ratio (default false)
exact <boolean> ..FV.... do exact cropping (default false)
Diese Vorgabe erzeugt zusätzliche Verluste der Qualität, s.a. Generationsverlust. Bei Bedarf sollte für die Bearbeitung ein anderer, verlustfreier Codec verwendet werden, bevor zum Abschluss in den passenden Zielcontainer konvertiert wird.
Schau Dir mal die umfangreiche Anleitung Technical Reminder: FFMPEG HSTACK, das Wiki "https://trac.ffmpeg.org/wiki/FilteringGuide" sowie Hilfe und Handbuch zu FFmpeg
man ffmpeg
ffmpeg -h
ffmpeg -h full
ffmpeg -h long
an.
Viel Spass ...