Benutzer-Werkzeuge

Webseiten-Werkzeuge


linux:allgemein:ffmpeg

Dies ist eine alte Version des Dokuments!


FFMPEG

Konvertieren

$ ffmpeg -i input.avi output.mp4

Mergen / Zusammenführen

$ ffmpeg -i "concat:input1.mpg|input2.mpg|input3.mpg" -c copy output.mpg

Automatisiertes Konvertieren

This is a typical scenario for find and xargs:

$ find /path/to/basedir -name '*.avi' -print0 | xargs -0 convert.sh

where -print0 and -0 ensure the proper handling of names with spaces.

And in convert.sh, you have your for loop, almost the same as in your first script:

#!/bin/bash

for i; do
    d=$(dirname "$i")
    b=$(basename "$i")
    ffmpeg -i "$i" -c:v libx265 -c:a copy "$d/X265_$b"
done

for i without anything means the same as „for all arguments given“, which are the files passed by xargs.

To prepend the filename with a string, you must split the name into the directory and base part, and then put it together again.

linux/allgemein/ffmpeg.1485325347.txt.gz · Zuletzt geändert: 25.01.2017 07:22 von marc