ffmpeg

Aus Foxwiki

ffmpeg bearbeitet und konvertiert Audio- und Videodateien

Beschreibung

Multimedia-Framework
Maintainer FFmpeg-Projekt
Betriebssystem Plattformübergreifend
Programmiersprache C
Lizenz LGPL/GPL
Logo

Das FFmpeg-Projekt besteht aus einer Reihe von freien Computerprogrammen und Programmbibliotheken, die digitales Video- und Audiomaterial aufnehmen, konvertieren, senden (streamen), filtern und in verschiedene Containerformate verpacken können.

Rechtliche Betrachtung

  • FFmpeg (bzw. libavcodec als Bestandteil von FFmpeg) enthält Implementierungen von mehr als 100 Codecs, von denen ein Teil von Patentinhabern angefochten werden könnte.
  • In manchen Gesetzgebungen könnten, aufgrund von vagen Hinweisen, eventuell Patentansprüche gegen verschiedene Standards, die FFmpeg unterstützt, geltend gemacht werden.
  • Weiterhin sind viele dieser Codecs unter Nutzungsbedingungen veröffentlicht worden, die Reverse Engineering untersagen; selbst zur Sicherstellung der Interoperabilität.
  • Solche Bedingungen sind in manchen Ländern allerdings unwirksam, so etwa in Deutschland

Installation

# apt install ffmpeg

Syntax

Optionen

Parameter

Umgebungsvariablen

Exit-Status

Anwendung

Audio

Quelle Ziel Befehl
wav mp3 ffmpeg -i audio.wav -acodec libmp3lame audio.mp3
wav ogg ffmpeg -i audio.wav -acodec libvorbis audio.ogg
wav aac ffmpeg -i audio.wav -acodec libfaac audio.aac
wav ac3 ffmpeg -i audio.wav -acodec ac3 audio.mp3
OGG mp3 ffmpeg -i audio.ogg -acodec libmp3lame audio.mp3
OGG wav ffmpeg -i audio.ogg audio.wav
OGG aac ffmpeg -i audio.ogg -acodec libfaac audio.aac
OGG ac3 ffmpeg -i audio.ogg -acodec ac3 audio.ac3
AC3 mp3 ffmpeg -i audio.ac3 -acodec libmp3lame audio.mp3
AC3 wav ffmpeg -i audio.ac3 audio.wav
AC3 aac ffmpeg -i audio.ac3 -acodec libfaac audio.aac
AC3 ogg ffmpeg -i audio.ac3 -acodec libvorbis audio.ogg
AAC mp3 ffmpeg -i audio.aac -acodec libmp3lame audio.mp3
AAC wav ffmpeg -i audio.aac audio.wav
AAC ac3 ffmpeg -i audio.aac -acodec ac3 audio.ac3
AAC ogg ffmpeg -i audio.aac -libvorbis audio.ogg

Video

Aufgabe Befehl
90 Grad nach rechts ffmp4 -i input.mp4 -vf "transpose=1" -qscale 0 output.mp4
90 Grad nach links ffmp4 -i input.mp4 -vf "transpose=2" -qscale 0 output.mp4
180 Grad ffmp4 -i input.mp4 -vf "hflip,vflip" -qscale 0 output.mp4
Video-Größe reduzieren ffmp4 -i input.mp4 [FIXME]
Tonspuren entfernen ffmpeg -i input.mp4 -an -c:v copy output.mp4

Tonspuren

Tonspuren entfernen

Videostrom ohne Ton kopieren

$ ffmpeg -i [input file] -an -c:v copy [output file]
Option Beschreibung
-an Tonspur ignorieren
-c:v copy Kopie ohne Neukodierung
Beispiel
$ ffmpeg -i input.mp4 -an -c:v copy output.mp4

Video-Größe

So i'm tried to reduce video filesize by scale down video -vf 640:-2, but nothing changes. Scale down or up doesnt affect video filesize

I've read ffmpeg wiki about Scaling but it dont have any information about scale and filesize.

When i'm scale down images, filesize have big drop but for video, nothing changes

  • Your question doesn't contain enough information. You need to show all the information about your video both before and after your attempt to reduce its size. Try using ffprobe on both.
  • i found other answer on website, he's said that resolution and codec are two different things, to reduce file size you must use better codec, in this case i'm using libx265
Answer

You can use -crf option to reduce final video size.

The range of the CRF scale is 0–51, where 0 is lossless (for 8 bit only, for 10 bit use -qp 0), 23 is the default, and 51 is worst quality possible.

-crf 23 (for default)

You have to use H.264 encoder. this will help almost all type of video. works batter in mp4 videos.

  • yes, -c:v libx265 -crf 25 -x265-params profile=main10 -preset fast -pix_fmt yuv420p10le with this, quality is better and file size is lower but encode time is longer, -vf scale is just for visual, not for size/quality
  • You can use '-preset ultrafast' for decrease conversion time. use that before your add your output path.
  • ok thank you, i will try that, hope quality is same and encode time is reduce
  • look like ultrafast = higher size, not reduce size at all, should fast or slow
  • -crf use for reduce the size of video and -preset is use for decrease conversion time. I personally used that.
  • Can you do sound and video separately? Like I want perfect sound but the video can be trash. It's for creating subtitles. Then I can add the subtitles to the high-quality video afterwards.

Konfiguration

Dateien

Anhang

Siehe auch

Man-Pages

  1. ffmpeg(1)

Links

Weblinks

  1. https://de.wikipedia.org/wiki/FFmpeg
  2. FFmpeg – offizielle Website
  3. Libav – offizielle Website
  4. FFmpeg DirectShow filter – ffdshow
  5. Grafische Benutzeroberfläche zu FFmpeg für Unix
  6. Grafische Benutzeroberfläche zu FFmpeg für MacOS
  7. Which is better: FFmpeg or GStreamer? Why?

GUI

  1. Multimedia Xpert
  2. Quick Time Komponente für Mac OS auf Basis von FFmpeg
  3. FOBS – Java und C++ Wrapper zum Einbinden von ffmpeg in eigene Programme